示例#1
0
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
}
示例#2
0
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
}
示例#3
0
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
0
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
0
func (trc *transactYieldCommand) Done(o *basic.Object) error {
	defer o.ProcessSeqnum()
	trc.tnode.checkExeOver()
	return nil
}
示例#6
0
func (ttc *taskExeCommand) Done(o *basic.Object) error {
	defer o.ProcessSeqnum()
	return ttc.t.run()
}
示例#7
0
func (cmd *cmdlineCommand) Done(o *basic.Object) error {
	defer o.ProcessSeqnum()
	cmd.exec.Execute(cmd.args)
	return nil
}
示例#8
0
func (trc *taskResCommand) Done(o *basic.Object) error {
	defer o.ProcessSeqnum()
	trc.t.n.Done(<-trc.t.r)
	return nil
}