Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sig ¶
Sig will send the Completed or Failed event to s depending on err being set if s is not nil.
func SigAll ¶
SigAll send the Completed or Failed event to all given signalers depending on err being set.
func SigCompleted ¶
func SigCompleted(s Signaler)
SigCompleted sends the Completed event to s if s is not nil.
Types ¶
type Canceler ¶
type Canceler struct {
// contains filtered or unexported fields
}
func NewCanceler ¶
func NewCanceler() *Canceler
type SignalCallback ¶
type SignalCallback func(SignalResponse)
SignalCallback converts a function accepting SignalResponse into a Signaler.
func (SignalCallback) Canceled ¶
func (f SignalCallback) Canceled()
func (SignalCallback) Completed ¶
func (f SignalCallback) Completed()
func (SignalCallback) Failed ¶
func (f SignalCallback) Failed()
type SignalChannel ¶
type SignalChannel struct {
C chan SignalResponse
}
func NewSignalChannel ¶
func NewSignalChannel() *SignalChannel
func (*SignalChannel) Canceled ¶
func (s *SignalChannel) Canceled()
func (*SignalChannel) Completed ¶
func (s *SignalChannel) Completed()
func (*SignalChannel) Failed ¶
func (s *SignalChannel) Failed()
func (*SignalChannel) Wait ¶
func (s *SignalChannel) Wait() SignalResponse
type SignalResponse ¶
type SignalResponse uint8
const ( SignalCompleted SignalResponse = iota + 1 SignalFailed SignalCanceled )
func (SignalResponse) Apply ¶
func (code SignalResponse) Apply(s Signaler)
type Signaler ¶
type Signaler interface { Completed() Failed() Canceled() }
func CancelableSignaler ¶
func CombineSignalers ¶
NewCompositeSignaler creates a new composite signaler.
func SplitSignaler ¶
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.
Click to show internal directories.
Click to hide internal directories.