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 }
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 }
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 }
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 }
func (trc *transactYieldCommand) Done(o *basic.Object) error { defer o.ProcessSeqnum() trc.tnode.checkExeOver() return nil }
func SendTaskExe(o *basic.Object, t *Task) bool { return o.SendCommand(&taskExeCommand{t: t}, true) }
func (ttc *taskExeCommand) Done(o *basic.Object) error { defer o.ProcessSeqnum() return ttc.t.run() }
func PostCmd(p *basic.Object, exec cmdExecuter, args []string) bool { return p.SendCommand(&cmdlineCommand{exec: exec, args: args}, true) }
func (cmd *cmdlineCommand) Done(o *basic.Object) error { defer o.ProcessSeqnum() cmd.exec.Execute(cmd.args) return nil }
func SendTaskRes(o *basic.Object, t *Task) bool { if o == nil { return false } return o.SendCommand(&taskResCommand{t: t}, true) }
func (trc *taskResCommand) Done(o *basic.Object) error { defer o.ProcessSeqnum() trc.t.n.Done(<-trc.t.r) return nil }