Documentation
¶
Index ¶
- Constants
- func Install(conf *Config) ctl.IControler
- func Listen(event IEvent, handle TEventHandler)
- func Post(event IEvent, orderly ...bool)
- func PostDo(event IEventDo, orderly ...bool)
- func Register(id TEventID, handle TEventHandler)
- type Config
- type Event
- type EventDo
- type IContrler
- type IEvent
- type IEventDo
- type TEventHandler
- type TEventID
- type Task
- type TaskHandFunc
- type TaskHandler
Constants ¶
View Source
const C_TASK_EXIT_TIME_OUT = 2 * time.Second // task 退出超时
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IContrler ¶
type IContrler interface {
ctl.IControler
// 监听事件(eventId重复则进行覆盖)
Listen(event IEvent, handle TEventHandler)
// 投递事件(sync:此时间是否需要被同步有序处理)
Post(event IEvent, sync ...bool)
// 投递事件并自动监听(sync:此时间是否需要被同步有序处理)
PostDo(event IEventDo, sync ...bool)
}
> 控制器接口
var (
Ctl IContrler // 默认事件系统控制器
)
func Controller ¶
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task
func (*Task) HandleFunc ¶
func (this *Task) HandleFunc(handFun TaskHandFunc)
func (*Task) Handler ¶
func (this *Task) Handler(handler TaskHandler)
type TaskHandFunc ¶
type TaskHandFunc func(param interface{}) (ret interface{}, err error)
func (TaskHandFunc) OnHandleTask ¶
func (f TaskHandFunc) OnHandleTask(param interface{}) (ret interface{}, err error)
type TaskHandler ¶
type TaskHandler interface {
OnHandleTask(param interface{}) (ret interface{}, err error)
}
==================== Task
Click to show internal directories.
Click to hide internal directories.