Documentation ¶
Index ¶
- Variables
- func SendTaskExe(o *basic.Object, t *Task) bool
- func SendTaskRes(o *basic.Object, t *Task) bool
- type Callable
- type CallableWrapper
- type CompleteNotify
- type CompleteNotifyWrapper
- type Configuration
- type Executor
- type Task
- func (t *Task) AddRefCnt(cnt int32) int32
- func (t *Task) BroadcastToAllExecutor() bool
- func (t *Task) Get() interface{}
- func (t *Task) GetCostTime() time.Duration
- func (t *Task) GetEnv(k interface{}) interface{}
- func (t *Task) GetRefCnt() int32
- func (t *Task) GetRunTime() time.Duration
- func (t *Task) GetWithTimeout(timeout time.Duration) interface{}
- func (t *Task) PutEnv(k, v interface{}) bool
- func (t *Task) SetAlertTime(alertt time.Duration)
- func (t *Task) Start()
- func (t *Task) StartByExecutor(name string) bool
- func (t *Task) StartByFixExecutor(name string) bool
- func (t *Task) StartByGroupExecutor(gname string, name string) bool
- func (t *Task) StartByGroupFixExecutor(name, gname string) bool
- type Worker
- type WorkerConfig
- type WorkerGroup
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TaskErr_CannotFindWorker = errors.New("Cannot find fit worker.") TaskErr_TaskExecuteObject = errors.New("Task can only be executed executor") )
View Source
var ( WorkerIdGenerator int32 = 0 WorkerInitialCnt = 8 WorkerVirtualNum = 8 TaskExecutor *Executor = NewExecutor() )
View Source
var Config = Configuration{}
View Source
var ErrTaskIsRunning = errors.New("mutex task is running")
Functions ¶
Types ¶
type CallableWrapper ¶
func (CallableWrapper) Call ¶
func (cw CallableWrapper) Call(o *basic.Object) interface{}
type CompleteNotify ¶
type CompleteNotify interface {
Done(interface{}, *Task)
}
type CompleteNotifyWrapper ¶
type CompleteNotifyWrapper func(interface{}, *Task)
func (CompleteNotifyWrapper) Done ¶
func (cnw CompleteNotifyWrapper) Done(i interface{}, t *Task)
type Configuration ¶
type Configuration struct { Options basic.Options Worker WorkerConfig }
func (*Configuration) Close ¶
func (c *Configuration) Close() error
func (*Configuration) Init ¶
func (c *Configuration) Init() error
func (*Configuration) Name ¶
func (c *Configuration) Name() string
type Executor ¶
func NewExecutor ¶
func NewExecutor() *Executor
func (*Executor) AddGroup ¶
func (e *Executor) AddGroup(gname string) *WorkerGroup
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func NewMutexTask ¶
func (*Task) BroadcastToAllExecutor ¶
func (*Task) GetCostTime ¶
func (*Task) GetRunTime ¶
func (*Task) GetWithTimeout ¶
func (*Task) SetAlertTime ¶
func (*Task) StartByExecutor ¶
func (*Task) StartByFixExecutor ¶
func (*Task) StartByGroupExecutor ¶
func (*Task) StartByGroupFixExecutor ¶
type WorkerConfig ¶
type WorkerGroup ¶
type WorkerGroup struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.