1
This commit is contained in:
parent
dd20317307
commit
c0fb80dd05
4
app.go
4
app.go
@ -52,6 +52,7 @@ type app struct {
|
||||
imMsgHandlers [1024]func(q5.Args)
|
||||
maxRunDelay int64
|
||||
maxScheduleTime int64
|
||||
uuid q5.Uuid
|
||||
userApp UserApp
|
||||
}
|
||||
|
||||
@ -81,6 +82,7 @@ func (this *app) init(userApp UserApp) {
|
||||
this.instanceId = int32(tmpInstanceId)
|
||||
flag.Parse()
|
||||
}
|
||||
this.uuid.SetMachineId((this.nodeId - 1) * MAX_NODE_ID + this.instanceId)
|
||||
this.loopCond = sync.NewCond(new(sync.Mutex))
|
||||
this.chGoLoopTimerExit = make(chan int)
|
||||
this.chGoLoopWait = make(chan int64)
|
||||
@ -124,7 +126,7 @@ func (this *app) run() {
|
||||
}
|
||||
|
||||
func (this *app) NewUuid() int64 {
|
||||
return 0
|
||||
return this.uuid.Generate()
|
||||
}
|
||||
|
||||
func (this *app) GetInstanceId() int32 {
|
||||
|
@ -7,3 +7,6 @@ const (
|
||||
const (
|
||||
WSP_SS_MAX_MSGID = 100
|
||||
)
|
||||
|
||||
const MAX_NODE_ID = 8
|
||||
const MAX_INSTANCE_ID = 500
|
||||
|
Loading…
x
Reference in New Issue
Block a user