1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package comm
- type TaskState int
- const (
- BT_STATE_QUITED_CACEL = -1
- BT_STATE_QUITED_EXCEPTION = -2
- BT_STATE_QUITED_NORMAL = -3
- BT_STATE_INIT = iota + 1
- BT_STATE_RUNING
- BT_STATE_EXCEPTION_RESTARTING
- BT_STATE_NORMAL_RESTARTING
- )
- type TaskRunCallback func(error)
- type Task interface {
- GetRuningState() TaskState
- CancelRuning()
- Restart()
- InitTask(interface{})
- Run(overCallback TaskRunCallback) error
- IsAsync() bool
- GetNats() *NatsBus
- SetNats(*NatsBus)
- GetName() string
- SetName(string)
- GetID() string
- SetID(string)
- }
- type EventTask interface {
- Task
- RegistorEvent(events string, listen EventListener)
-
- EmitEvent(name string, data interface{}) (interface{}, error)
- }
|