Versions in this module Expand all Collapse all v1 v1.3.2 Jun 27, 2023 v1.3.1 Jun 13, 2023 v1.3.0 Jun 13, 2023 v1.2.8 Jun 6, 2023 v1.2.7 Jun 6, 2023 v1.2.6 Jun 2, 2023 v1.2.5 Jun 2, 2023 v1.2.3 Jun 2, 2023 v1.2.2 Jun 2, 2023 v1.2.0 May 30, 2023 v1.1.2 May 30, 2023 v1.1.1 May 30, 2023 v1.1.0 May 30, 2023 Changes in this version + type BaseEngineStatistics = WorkStatistics type BaseTaskMeta + func (t *BaseTaskMeta[KEY]) OrderKey() int type Engine + func (e *Engine[KEY, T, W]) AddNoPriorityTask(task *Task[KEY, T]) + func (e *Engine[KEY, T, W]) AddNoPriorityTasks(tasks ...*Task[KEY, T]) + func (e *Engine[KEY, T, W]) ErrHandlerUtilSuccess() *Engine[KEY, T, W] + func (e *Engine[KEY, T, W]) SourceTask(task func(*Engine[KEY, T, W])) + func (e *Engine[KEY, T, W]) TaskSource(source <-chan *Task[KEY, T]) v1.0.0 Mar 30, 2023 Changes in this version + const KindNormal + func ReTry(times int, f func() error) + type BaseEngine struct + func NewBaseEngine(workerCount uint) *BaseEngine[KEY, T, W] + func NewBaseEngineWithContext(workerCount uint, ctx context.Context) *BaseEngine[KEY, T, W] + func (e *BaseEngine[KEY, T, W]) AddFixedTask(workerId int, task *BaseTask[KEY, T]) + func (e *BaseEngine[KEY, T, W]) AddTask(task *BaseTask[KEY, T]) + func (e *BaseEngine[KEY, T, W]) AddTasks(tasks ...*BaseTask[KEY, T]) + func (e *BaseEngine[KEY, T, W]) AddWorker(num int) + func (e *BaseEngine[KEY, T, W]) Cancel() + func (e *BaseEngine[KEY, T, W]) Context() context.Context + func (e *BaseEngine[KEY, T, W]) MonitorInterval(interval time.Duration) + func (e *BaseEngine[KEY, T, W]) NewFixedWorker(interval time.Duration) int + func (e *BaseEngine[KEY, T, W]) RandSpeedLimited(start, stop time.Duration) + func (e *BaseEngine[KEY, T, W]) Release() + func (e *BaseEngine[KEY, T, W]) Run(tasks ...*BaseTask[KEY, T]) + func (e *BaseEngine[KEY, T, W]) RunSingleWorker(tasks ...*BaseTask[KEY, T]) + func (e *BaseEngine[KEY, T, W]) SpeedLimited(interval time.Duration) + func (e *BaseEngine[KEY, T, W]) SyncRun(tasks ...*BaseTask[KEY, T]) + type BaseTask struct + Props T + type BaseTaskFunc func(context.Context) + type BaseTaskMeta struct + Describe string + Key KEY + Priority int + func (t *BaseTaskMeta[KEY]) CmpKey() int + func (t *BaseTaskMeta[KEY]) SetPriority(priority int) + type Controller chan func() error + func (c Controller) AddTask(f func() error) + func (c Controller) Start() + type Engine struct + func NewEngine(workerCount uint) *Engine[KEY, T, W] + func (e *Engine[KEY, T, W]) AddFixedTask(workerId int, task *Task[KEY, T]) + func (e *Engine[KEY, T, W]) AddTask(task *Task[KEY, T]) + func (e *Engine[KEY, T, W]) AddTasks(generation int, tasks ...*Task[KEY, T]) + func (e *Engine[KEY, T, W]) AddTasksWrapper(generation int, tasks ...*Task[KEY, T]) + func (e *Engine[KEY, T, W]) AsyncAddTask(generation int, tasks ...*Task[KEY, T]) + func (e *Engine[KEY, T, W]) BaseTask(task *Task[KEY, T]) *BaseTask[KEY, T] + func (e *Engine[KEY, T, W]) ErrHandler(errHandler func(task *Task[KEY, T])) *Engine[KEY, T, W] + func (e *Engine[KEY, T, W]) KindGroupTimer(interval time.Duration, kinds ...Kind) *Engine[KEY, T, W] + func (e *Engine[KEY, T, W]) Limiter(kind Kind, r rate.Limit, b int) *Engine[KEY, T, W] + func (e *Engine[KEY, T, W]) ReRun(tasks ...*Task[KEY, T]) + func (e *Engine[KEY, T, W]) Release() + func (e *Engine[KEY, T, W]) Run(tasks ...*Task[KEY, T]) + func (e *Engine[KEY, T, W]) RunSingleWorker(tasks ...*Task[KEY, T]) + func (e *Engine[KEY, T, W]) SkipKind(kinds ...Kind) *Engine[KEY, T, W] + func (e *Engine[KEY, T, W]) StopAfter(interval time.Duration) *Engine[KEY, T, W] + func (e *Engine[KEY, T, W]) Timer(kind Kind, interval time.Duration) *Engine[KEY, T, W] + type EngineStatistics = WorkStatistics + type ErrHandle func(context.Context, error) + type Kind uint8 + type KindConfig struct + type KindEngine struct + func (e *KindEngine[KEY, T, W]) Run() + type KindHandler struct + HandleFun TaskFunc[KEY, T] + Limiter *rate.Limiter + Skip bool + Ticker *time.Ticker + type SchedulingContext struct + Done bool + func (c *SchedulingContext) Monitor() func() + type Task struct + Props P + func AnonymousTask(fun BaseTaskFunc) *Task[KEY, T] + func NewTask(baseTask *BaseTask[KEY, T]) *Task[KEY, T] + func (t *Task[KEY, P]) BaseTask(handle func(tasks []*Task[KEY, P], err error)) *BaseTask[KEY, P] + func (t *Task[KEY, P]) Errs() []error + type TaskFunc func(ctx context.Context) ([]*Task[KEY, P], error) + type TaskMeta struct + Kind Kind + func (r *TaskMeta[KEY]) Id() uint64 + func (r *TaskMeta[KEY]) SetKey(key KEY) + func (r *TaskMeta[KEY]) SetKind(k Kind) + type TaskStatistics struct + ErrTimes int + type Tasks []*Task[KEY, P] + type WorkStatistics struct + type Worker struct + Id uint + Kind Kind + Props W