Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Defer ¶
func Defer(d Doner, cb func())
Defer guarantees that a function will be called after a context has cancelled
func FTick ¶
func FTick(d Doner, f func())
FTick calls a function in a loop until the Doner has fired
func FTickInterval ¶
FTickInterval calls a function repeatedly at a given internval, until the Doner has fired. Note that FTickInterval ignores the time spent executing a function, and instead guarantees an interval of `t` between of return of the previous function call and the invocation of the next function call.
Types ¶
type BindFunc ¶
type BindFunc func(Doner)
BindFunc is an adapter to allow the use of ordinary functions as Binders.
type Binder ¶
type Binder interface {
Bind(Doner)
}
Binder is the interface that wraps the basic Bind method. Bind executes logic until the Doner completes. Implementations of Bind must not return until the Doner has completed.
type C ¶
type C <-chan struct{}
C is a basic implementation of Doner
func Background ¶
func Background() C
Background is the ctx analog to context.Background(). It never fires.
func FDone ¶
func FDone(f func()) C
FDone returns a doner that fires when the function returns or panics
func WithCancel ¶
WithCancel returns a new Doner that can be cancelled via the associated function
Directories
¶
Path | Synopsis |
---|---|
Package mergectx provides a utility for merging two context.Context objects, creating a child context that contains the union of both context's values.
|
Package mergectx provides a utility for merging two context.Context objects, creating a child context that contains the union of both context's values. |
Package refctx provides a context tied to a reference-counter.
|
Package refctx provides a context tied to a reference-counter. |
Package sigctx provides a context that expires when a SIGINT or SIGTERM is received.
|
Package sigctx provides a context that expires when a SIGINT or SIGTERM is received. |