コード例 #1
0
ファイル: delaying_queue.go プロジェクト: 40a/bootkube
func newDelayingQueue(clock util.Clock) DelayingInterface {
	ret := &delayingType{
		Interface:       New(),
		clock:           clock,
		heartbeat:       clock.Tick(maxWait),
		stopCh:          make(chan struct{}),
		waitingForAddCh: make(chan waitFor, 1000),
	}

	go ret.waitingLoop()

	return ret
}
コード例 #2
0
ファイル: delaying_queue.go プロジェクト: ncdc/origin
func newDelayingQueue(clock util.Clock, name string) DelayingInterface {
	ret := &delayingType{
		Interface:          NewNamed(name),
		clock:              clock,
		heartbeat:          clock.Tick(maxWait),
		stopCh:             make(chan struct{}),
		waitingTimeByEntry: map[t]time.Time{},
		waitingForAddCh:    make(chan waitFor, 1000),
		metrics:            newRetryMetrics(name),
	}

	go ret.waitingLoop()

	return ret
}