Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TaskAlreadyExistsError is returned when attempting to run a task that is // already registered and running. TaskAlreadyExistsError = errors.New("task already exists") // TaskUndefinedError is returned when attempting to stop a task that is not // registered or has already completed. TaskUndefinedError = errors.New("task is undefined") )
View Source
var Component = &component.Component{ Name: "runner", Init: component.StepFunc(func(container container.Container) error { return container.Provides( newRunner, func(r *runner) Runner { return r }, ) }), Stop: component.StepFunc(func(container container.Container) error { return container.Invoke(func(d *runner) error { return d.Close() }) }), }
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware interface {
Middleware(Process, ProcessFunc) ProcessFunc
}
type MiddlewareFunc ¶
type MiddlewareFunc func(Process, ProcessFunc) ProcessFunc
func (MiddlewareFunc) Middleware ¶
func (m MiddlewareFunc) Middleware(p Process, next ProcessFunc) ProcessFunc
type ProcessFunc ¶
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func NewTask ¶
func NewTask(name string, processFunc ProcessFunc, middlewares ...Middleware) *Task
Click to show internal directories.
Click to hide internal directories.