make delayed workqueue use channels with single writer
This commit is contained in:
@@ -26,6 +26,7 @@ type Interface interface {
|
||||
Get() (item interface{}, shutdown bool)
|
||||
Done(item interface{})
|
||||
ShutDown()
|
||||
ShuttingDown() bool
|
||||
}
|
||||
|
||||
// New constructs a new workqueue (see the package comment).
|
||||
@@ -143,3 +144,10 @@ func (q *Type) ShutDown() {
|
||||
q.shuttingDown = true
|
||||
q.cond.Broadcast()
|
||||
}
|
||||
|
||||
func (q *Type) ShuttingDown() bool {
|
||||
q.cond.L.Lock()
|
||||
defer q.cond.L.Unlock()
|
||||
|
||||
return q.shuttingDown
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user