1
This commit is contained in:
parent
32124c9aa4
commit
d9013f408e
12
app.go
12
app.go
@ -86,6 +86,12 @@ func (this *app) init(userApp UserApp) {
|
|||||||
this.loopCond = sync.NewCond(new(sync.Mutex))
|
this.loopCond = sync.NewCond(new(sync.Mutex))
|
||||||
this.chGoLoopTimerExit = make(chan int)
|
this.chGoLoopTimerExit = make(chan int)
|
||||||
this.chGoLoopWait = make(chan int64)
|
this.chGoLoopWait = make(chan int64)
|
||||||
|
_app.RegisterIMMsgHandle(
|
||||||
|
IM_EXEC_MAIN_THREAD_CB,
|
||||||
|
func (args q5.Args) {
|
||||||
|
cb := args[0].(func ())
|
||||||
|
cb()
|
||||||
|
})
|
||||||
this.outputRuningLog()
|
this.outputRuningLog()
|
||||||
GetSysLog().Info("node_id:%d instance_id:%d pid:%d",
|
GetSysLog().Info("node_id:%d instance_id:%d pid:%d",
|
||||||
this.nodeId,
|
this.nodeId,
|
||||||
@ -172,7 +178,11 @@ func (this *app) RegisterIMMsgHandle(msgId uint16, handle func(q5.Args)) {
|
|||||||
this.imMsgHandlers[msgId] = handle
|
this.imMsgHandlers[msgId] = handle
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *app) RegisterMainThreadCb(func ()) {
|
func (this *app) RegisterMainThreadCb(cb func ()) {
|
||||||
|
_app.AddIMMsg(IM_EXEC_MAIN_THREAD_CB,
|
||||||
|
[]interface{} {
|
||||||
|
cb,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *app) goLoopTimer() {
|
func (this *app) goLoopTimer() {
|
||||||
|
@ -2,6 +2,7 @@ package f5
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
IM_HTTP_CLI_MGR_RESPONSE = 1
|
IM_HTTP_CLI_MGR_RESPONSE = 1
|
||||||
|
IM_EXEC_MAIN_THREAD_CB = iota
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user