Documentation ¶
Overview ¶
Supports starting many cancellable goroutines whose exit and their error codes we can wait on.
Works similar to golang.org/x/sync/errgroup but provides richer logging (tasks are named) and errors
- The tasks are expected to run forever, until context cancellation (e.g. task stopping before cancellation even with nil error is considered an error).
- If any of the tasks fail, sibling tasks are canceled as well.
Index ¶
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) Done ¶
same semantics as Wait(), but returns chan so you can do other stuff while waiting.
NOTE: same note as for Wait()
func (*Runner) Start ¶
not safe to be called after you call Wait() or Done() not safe for concurrent use
func (*Runner) Wait ¶
Returns: - nil if all task exits were expected and errors were nil - err if any of the tasks exited unexpectedly or exit was expected but errored
NOTE: don't have multiple goroutines concurrently use Done() or Wait(). i.e. you can
call Done() and even after that call Wait(), but don't do it concurrently (the channel only sends one value)
Click to show internal directories.
Click to hide internal directories.