(clock clock.Clock, name string)
| 43 | } |
| 44 | |
| 45 | func newDelayingQueue(clock clock.Clock, name string) DelayingInterface { |
| 46 | ret := &delayingType{ |
| 47 | Interface: NewNamed(name), |
| 48 | clock: clock, |
| 49 | heartbeat: clock.NewTicker(maxWait), |
| 50 | stopCh: make(chan struct{}), |
| 51 | waitingForAddCh: make(chan *waitFor, 1000), |
| 52 | metrics: newRetryMetrics(name), |
| 53 | deprecatedMetrics: newDeprecatedRetryMetrics(name), |
| 54 | } |
| 55 | |
| 56 | go ret.waitingLoop() |
| 57 | |
| 58 | return ret |
| 59 | } |
| 60 | |
| 61 | // delayingType wraps an Interface and provides delayed re-enquing |
| 62 | type delayingType struct { |