Documentation
¶
Overview ¶
Package taskloop implements a task loop to run tasks sequentially in a separate Goroutine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("the agent is closed")
ErrClosed indicates that the loop has been stopped
Functions ¶
This section is empty.
Types ¶
type Loop ¶
type Loop struct {
// contains filtered or unexported fields
}
Loop runs submitted task serially in a dedicated Goroutine
func (*Loop) Close ¶
func (l *Loop) Close()
Close stops the loop after finishing the execution of the current task. Other pending tasks will not be executed.
func (*Loop) Done ¶
func (l *Loop) Done() <-chan struct{}
Done returns a channel that's closed when the task loop has been stopped.
func (*Loop) Err ¶
Err returns nil if the task loop is still running. Otherwise it return errClosed if the loop has been closed/stopped.
Click to show internal directories.
Click to hide internal directories.