Documentation ¶
Index ¶
- type Runner
- func (r *Runner) NumTasks() uint64
- func (r *Runner) Run(f func(context.Context)) (context.CancelFunc, error)
- func (r *Runner) RunC(ctx context.Context, f func(context.Context)) error
- func (r *Runner) State() State
- func (r *Runner) Stop()
- func (r *Runner) String() string
- func (r *Runner) WithManagedCancel(parent context.Context) (context.Context, context.CancelFunc)
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) WithManagedCancel ¶
WithManagedCancel returns a copy of parent with a new Done channel. The returned context's Done channel is closed when the returned cancel function is called or when the parent context's Done channel is closed, whichever happens first. Moreover, the returned context is managed by runner, thus, if the runner is stopped, the context is also canceled.
Canceling this context releases resources associated with it, so code should call cancel as soon as the operations running in this Context complete.
Click to show internal directories.
Click to hide internal directories.