示例#1
0
func New() *Dumb {
	q := queue.NewBasicTBQueue()
	d := &Dumb{
		nextActionChan: make(chan signal.Action),
		queue:          q,
		queueDeqCh:     q.GetDequeueChan(),
		Interval:       time.Duration(0),
	}
	go d.dequeueEventRoutine()
	return d
}
示例#2
0
func New() *Random {
	nextActionChan := make(chan signal.Action)
	q := queue.NewBasicTBQueue()
	r := &Random{
		nextActionChan:           nextActionChan,
		queue:                    q,
		queueDeqCh:               q.GetDequeueChan(),
		shelActionRoutineRunning: false,
		MinInterval:              time.Duration(0),
		MaxInterval:              time.Duration(0),
		PrioritizedEntities:      make(map[string]bool, 0),
		ShellActionInterval:      time.Duration(0),
		ShellActionCommand:       "",
		FaultActionProbability:   0.0,
	}
	go r.dequeueEventRoutine()
	return r
}