Documentation
¶
Index ¶
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 = NewExecutor() )
View Source
var Config = Configuration{}
View Source
var ErrTaskIsRunning = errors.New("mutex task is running")
Functions ¶
func SendTaskRes ¶
func SendTaskRes(o *basic.Object, t Task, n CompleteNotify) bool
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 interface { AddRefCnt(cnt int32) int32 GetRefCnt() int32 Get() interface{} GetWithTimeout(timeout time.Duration) interface{} GetEnv(k interface{}) interface{} PutEnv(k, v interface{}) bool SetAlertTime(alertt time.Duration) GetCostTime() time.Duration GetRunTime() time.Duration Start() StartByExecutor(name string) bool StartByFixExecutor(name string) bool BroadcastToAllExecutor() bool StartByGroupExecutor(gname string, name string) bool StartByGroupFixExecutor(name, gname string) bool // contains filtered or unexported methods }
func NewMutexTask ¶
func RunShareTask ¶
type WorkerConfig ¶
type WorkerGroup ¶
type WorkerGroup struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.