Function
newQueue
(c clock.Clock, metrics queueMetrics, updatePeriod time.Duration)
Source from the content-addressed store, hash-verified
| 47 | } |
| 48 | |
| 49 | func newQueue(c clock.Clock, metrics queueMetrics, updatePeriod time.Duration) *Type { |
| 50 | t := &Type{ |
| 51 | clock: c, |
| 52 | dirty: set{}, |
| 53 | processing: set{}, |
| 54 | cond: sync.NewCond(&sync.Mutex{}), |
| 55 | metrics: metrics, |
| 56 | unfinishedWorkUpdatePeriod: updatePeriod, |
| 57 | } |
| 58 | go t.updateUnfinishedWorkLoop() |
| 59 | return t |
| 60 | } |
| 61 | |
| 62 | const defaultUnfinishedWorkUpdatePeriod = 500 * time.Millisecond |
| 63 | |