本文整理匯總了Golang中github.com/idealeak/goserver/core/basic.Object類的典型用法代碼示例。如果您正苦於以下問題:Golang Object類的具體用法?Golang Object怎麽用?Golang Object使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Object類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Done
func (stc *stopTimerCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
if v, ok := TimerModule.tq.ref[stc.h]; ok {
heap.Remove(TimerModule.tq, v)
}
return nil
}
示例2: Done
func (tc *timeoutCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
if tc.te.ta.OnTimer(tc.te.h, tc.te.ud) == false {
if tc.te.times < 0 {
StopTimer(tc.te.h)
}
}
return nil
}
示例3: Done
func (trc *taskReqCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
workerName, err := TaskExecutor.c.Get(trc.n)
if err != nil {
return err
}
worker := TaskExecutor.GetWorker(workerName)
if worker != nil {
SendTaskExe(worker.Object, trc.t)
} else {
return TaskErr_CannotFindWorker
}
return nil
}
示例4: Done
func (stc *startTimerCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
te := &TimerEntity{
sink: o,
ud: stc.ud,
ta: stc.ta,
interval: stc.interval,
times: stc.times,
h: stc.h,
next: time.Now().Add(stc.interval),
}
heap.Push(TimerModule.tq, te)
return nil
}
示例5: Done
func (trc *transactYieldCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
trc.tnode.checkExeOver()
return nil
}
示例6: SendTaskExe
func SendTaskExe(o *basic.Object, t *Task) bool {
return o.SendCommand(&taskExeCommand{t: t}, true)
}
示例7: Done
func (ttc *taskExeCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
return ttc.t.run()
}
示例8: PostCmd
func PostCmd(p *basic.Object, exec cmdExecuter, args []string) bool {
return p.SendCommand(&cmdlineCommand{exec: exec, args: args}, true)
}
示例9: Done
func (cmd *cmdlineCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
cmd.exec.Execute(cmd.args)
return nil
}
示例10: SendTaskRes
func SendTaskRes(o *basic.Object, t *Task) bool {
if o == nil {
return false
}
return o.SendCommand(&taskResCommand{t: t}, true)
}
示例11: Done
func (trc *taskResCommand) Done(o *basic.Object) error {
defer o.ProcessSeqnum()
trc.t.n.Done(<-trc.t.r)
return nil
}