Documentation ¶
Overview ¶
Package goroutines provides utilities to perform common tasks on goroutines
Index ¶
- Variables
- type Go
- func (x Go) AddToGroup(wg *sync.WaitGroup) Go
- func (x Go) After(after func(), deferred ...bool) Go
- func (x Go) Before(before func()) Go
- func (x Go) EnsureStarted() Go
- func (x Go) Go(f func()) error
- func (x Go) Recover(recoverFunc func(interface{})) Go
- func (x Go) Timeout(timeout time.Duration) Go
- func (x Go) WithContext(ctx context.Context, f func(context.Context)) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTimeout is a timeout error ErrTimeout error = _error(`TIMEOUT`) )
Functions ¶
This section is empty.
Types ¶
type Go ¶
type Go struct {
// contains filtered or unexported fields
}
Go provides a fluent way to prepare & start a goroutine
func (Go) AddToGroup ¶
AddToGroup registers the goroutine in a sync.WaitGroup by adding necessary code (Add/Done)
func (Go) Before ¶
Before will be called before the goroutine func at the begining of the same goroutine
func (Go) EnsureStarted ¶
EnsureStarted instructs Go to start a goroutine and wait for it to start, and after goroutine started, it returns.
Click to show internal directories.
Click to hide internal directories.