Versions in this module Expand all Collapse all v1 v1.0.0 Dec 19, 2023 Changes in this version + var Config = Configuration + var ErrTaskIsRunning = errors.New("mutex task is running") + var TaskErr_CannotFindWorker = errors.New("Cannot find fit worker.") + var TaskErr_TaskExecuteObject = errors.New("Task can only be executed executor") + var TaskExecutor = NewExecutor() + var WorkerIdGenerator int32 = 0 + var WorkerInitialCnt = 8 + var WorkerVirtualNum = 8 + func SendTaskExe(o *basic.Object, t Task) bool + func SendTaskRes(o *basic.Object, t Task, n CompleteNotify) bool + type Callable interface + Call func(*basic.Object) interface{} + type CallableWrapper func(o *basic.Object) interface + func (cw CallableWrapper) Call(o *basic.Object) interface{} + type CompleteNotify interface + Done func(interface{}, Task) + type CompleteNotifyWrapper func(interface{}, Task) + func (cnw CompleteNotifyWrapper) Done(i interface{}, t Task) + type Configuration struct + Options basic.Options + Worker WorkerConfig + func (c *Configuration) Close() error + func (c *Configuration) Init() error + func (c *Configuration) Name() string + type Executor struct + func NewExecutor() *Executor + func (e *Executor) AddGroup(gname string) *WorkerGroup + func (e *Executor) Start() + type Task interface + AddRefCnt func(cnt int32) int32 + BroadcastToAllExecutor func() bool + Get func() interface{} + GetCostTime func() time.Duration + GetEnv func(k interface{}) interface{} + GetRefCnt func() int32 + GetRunTime func() time.Duration + GetWithTimeout func(timeout time.Duration) interface{} + PutEnv func(k, v interface{}) bool + SetAlertTime func(alertt time.Duration) + Start func() + StartByExecutor func(name string) bool + StartByFixExecutor func(name string) bool + StartByGroupExecutor func(gname string, name string) bool + StartByGroupFixExecutor func(name, gname string) bool + func New(s *basic.Object, c Callable, n CompleteNotify, name ...string) Task + func NewMutexTask(s *basic.Object, c Callable, n CompleteNotify, key, name string) (t Task, done bool) + func RunShareTask(s *basic.Object, c Callable, n CompleteNotify, key, name string) (t Task, done bool) + type Worker struct + type WorkerConfig struct + Options basic.Options + WorkerCnt int + type WorkerGroup struct