1
This commit is contained in:
parent
69d556c643
commit
5df419b966
16
app.go
16
app.go
@ -1,9 +1,11 @@
|
||||
package f5
|
||||
|
||||
import "flag"
|
||||
import "sync"
|
||||
import "time"
|
||||
import "q5"
|
||||
import (
|
||||
"flag"
|
||||
"sync"
|
||||
"time"
|
||||
"q5"
|
||||
)
|
||||
|
||||
type App_ struct {
|
||||
nodeId int
|
||||
@ -19,10 +21,12 @@ type App_ struct {
|
||||
imWorkNode *IMMsgNode
|
||||
imMsgMutex sync.RWMutex
|
||||
chGoLoopTimerExit chan int
|
||||
nowTime time.Time
|
||||
imMsgHandlers [1024]func(int16,*q5.XParams)
|
||||
}
|
||||
|
||||
func (this *App_) Init() {
|
||||
this.nowTime = time.Now()
|
||||
_Timer = &q5.Timer{}
|
||||
_Timer.Init(
|
||||
func (context interface{}) int64 {
|
||||
@ -60,6 +64,7 @@ func (this *App_) UnInit() {
|
||||
|
||||
func (this *App_) Run() {
|
||||
for !this.terminated {
|
||||
this.nowTime = time.Now()
|
||||
_Timer.Update()
|
||||
this.schedule()
|
||||
}
|
||||
@ -129,3 +134,6 @@ func (this *App_) schedule() {
|
||||
this.loopCond.L.Unlock()
|
||||
}
|
||||
|
||||
func (this *App_) NowUnix() int64 {
|
||||
return this.nowTime.Unix()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user