beats: github.com/elastic/beats/libbeat/common/op Index | Files

package op

import "github.com/elastic/beats/libbeat/common/op"

Index

Package Files

cancel.go signal.go signal_util.go

func Sig Uses

func Sig(s Signaler, err error)

Sig will send the Completed or Failed event to s depending on err being set if s is not nil.

func SigAll Uses

func SigAll(signalers []Signaler, err error)

SigAll send the Completed or Failed event to all given signalers depending on err being set.

func SigCompleted Uses

func SigCompleted(s Signaler)

SigCompleted sends the Completed event to s if s is not nil.

func SigFailed Uses

func SigFailed(s Signaler, err error)

SigFailed sends the Failed event to s if s is not nil.

type Canceler Uses

type Canceler struct {
    // contains filtered or unexported fields
}

func NewCanceler Uses

func NewCanceler() *Canceler

func (*Canceler) Cancel Uses

func (c *Canceler) Cancel()

func (*Canceler) Done Uses

func (c *Canceler) Done() <-chan struct{}

type SignalCallback Uses

type SignalCallback func(SignalResponse)

SignalCallback converts a function accepting SignalResponse into a Signaler.

func (SignalCallback) Canceled Uses

func (f SignalCallback) Canceled()

func (SignalCallback) Completed Uses

func (f SignalCallback) Completed()

func (SignalCallback) Failed Uses

func (f SignalCallback) Failed()

type SignalChannel Uses

type SignalChannel struct {
    C chan SignalResponse
}

func NewSignalChannel Uses

func NewSignalChannel() *SignalChannel

func (*SignalChannel) Canceled Uses

func (s *SignalChannel) Canceled()

func (*SignalChannel) Completed Uses

func (s *SignalChannel) Completed()

func (*SignalChannel) Failed Uses

func (s *SignalChannel) Failed()

func (*SignalChannel) Wait Uses

func (s *SignalChannel) Wait() SignalResponse

type SignalResponse Uses

type SignalResponse uint8
const (
    SignalCompleted SignalResponse = iota + 1
    SignalFailed
    SignalCanceled
)

func (SignalResponse) Apply Uses

func (code SignalResponse) Apply(s Signaler)

type Signaler Uses

type Signaler interface {
    Completed()
    Failed()
    Canceled()
}

func CancelableSignaler Uses

func CancelableSignaler(c *Canceler, s Signaler) Signaler

func CombineSignalers Uses

func CombineSignalers(signalers ...Signaler) Signaler

NewCompositeSignaler creates a new composite signaler.

func SplitSignaler Uses

func SplitSignaler(s Signaler, count int) Signaler

NewSplitSignaler creates a new splitSignal if s is not nil. If s is nil, nil will be returned. The count is the number of events to be received before publishing the final event to the guarded Signaler.

Package op imports 3 packages (graph) and is imported by 229 packages. Updated 2018-06-25. Refresh now. Tools for package owners.