Documentation ¶
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
}
Runner is a useful feature for background goroutine life cycle control. It wraps the sync.WaitGroup and provides a channel for receiving the close notify signal. It's used in background go routine loop task as usual. All method are thread-safe and reentrant.
func NewRunner ¶
func NewRunner() *Runner
NewRunner create a Runner object, the typical usage is embed in an object. See testing example for more detail.
func NewRunnerWithContext ¶
NewRunnerWithContext create a Runner object which could control by context or call CloseWait method.
func (*Runner) CloseWait ¶
func (r *Runner) CloseWait()
CloseWait will stop the runner by close the signal channel and wait for the sync.WaitGroup all Done Synchronously
Click to show internal directories.
Click to hide internal directories.