func newDelayingQueue(clock clock.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 }