Versions in this module Expand all Collapse all v0 v0.4.0 Apr 28, 2022 Changes in this version + func FilterEventFunc(mode Mode) func(*Event) bool + func IsFirstSuccessOrLastResult(e *Event) bool + func IsResult(e *Event) bool + func IsResultUntilFirstSuccess(e *Event) bool + func IsSuccessOrError(e *Event) bool type EventType + func (t EventType) MarshalJSON() ([]byte, error) v0.3.0 Apr 15, 2022 Changes in this version type Result + String func() string v0.2.0 Apr 13, 2022 v0.1.0 Apr 11, 2022 Changes in this version + type Engine struct + func NewEngine(ctx context.Context, ws []*Worker, wts WorkerTasks) (*Engine, error) + func (eng *Engine) Execute(mode Mode) (chan Result, error) + func (eng *Engine) ExecuteEvents() (chan *Event, error) + type Event struct + Result Result + Task Task + TaskStat TaskStat + TimeEnd time.Time + TimeStart time.Time + WorkerID WorkerID + WorkerInst int + func (e *Event) IsFirstSuccessOrLastResult() bool + func (e *Event) IsResult() bool + func (e *Event) IsResultUntilFirstSuccess() bool + func (e *Event) IsSuccessOrError() bool + func (e *Event) String() string + func (e *Event) Type() EventType + type EventType int + const EventCanceled + const EventError + const EventNil + const EventStart + const EventSuccess + func (t EventType) String() string + type Mode int + const AllResults + const FirstSuccessOrLastResult + const ResultsUntilFirstSuccess + const SuccessOrErrorResults + type Result interface + Error func() error + type Task interface + TaskID func() TaskID + type TaskID string + type TaskStat struct + Doing int + Done int + Success int + Todo int + func (stat *TaskStat) Completed() bool + func (stat TaskStat) String() string + type Tasks []Task + type WorkFunc func(context.Context, *Worker, int, Task) Result + type Worker struct + Instances int + Work WorkFunc + WorkerID WorkerID + type WorkerID string + type WorkerTasks map[WorkerID]Tasks + func (wts WorkerTasks) Clone() WorkerTasks