Versions in this module Expand all Collapse all v0 v0.0.2 Jan 15, 2021 v0.0.1 Jan 14, 2021 Changes in this version + const Cancelled + const Done + const FailedTask + const Finalizing + const FinishedTask + const New + const Oneshot + const OneshotRunning + const PendingTask + const Recurrent + const RecurrentRunning + const RunningTask + const WaitingForPrereq + var DefaultLogLevel int + var ErrAssertZeroValue = errors.New("go-work.Assert: zero value") + var ErrJobExecTimeout = errors.New("go-work: job execution timed out") + var ErrTaskIdleTimeout = errors.New("go-work: task idling timed out") + var NotifySig = struct{} + func NewJob(value interface{}) *job + func RegisterDefaultLogger(logger Logger) + type Finalize func(Task) + type Init func(Task) + type Job interface + AddOneshotTask func(job JobTask) + AddTask func(job JobTask) *task + AddTaskWithIdleTimeout func(job JobTask, timeout time.Duration) *task + Cancel func(err interface{}) + Finish func() + GetInterruptedBy func() (*task, interface{}) + GetState func() jobState + GetTaskByIndex func(index int) *task + GetValue func() interface{} + JobDoneNotify func() chan struct{} + Log func(level int) chan<- interface{} + RegisterLogger func(logger Logger) + Run func() chan struct{} + RunInBackground func() <-chan struct{} + SetValue func(v interface{}) + TaskDoneNotify func() <-chan *task + WithPrerequisites func(sigs ...<-chan struct{}) + WithTimeout func(duration time.Duration) + type JobTask func(j Job) (Init, Run, Finalize) + type LogLevelMap map[int]*LogLevelMapItem + type LogLevelMapItem struct + func NewLogLevelMapItem(ch chan interface{}, handler LogRecordHandler) *LogLevelMapItem + type LogRecordHandler func(entry interface{}, level int) + type Logger func() LogLevelMap + type OneshotTask JobTask + type Run func(Task) + type Task interface + Assert func(err interface{}) + AssertNotNil func(value interface{}) + AssertTrue func(cond bool, err string) + Done func() + FinishJob func() + GetIndex func() int + GetJob func() Job + GetResult func() interface{} + GetState func() taskState + Idle func() + SetResult func(result interface{}) + Tick func()