X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d89b7ae1f6fa35dd3627ead14c855751f1de2193..386faadf691e444b71d6c96e7c00792d9a0ba2c7:/services/keepstore/work_queue.go diff --git a/services/keepstore/work_queue.go b/services/keepstore/work_queue.go index 58e4966595..27646ad3d8 100644 --- a/services/keepstore/work_queue.go +++ b/services/keepstore/work_queue.go @@ -84,18 +84,20 @@ package main import "container/list" +// WorkQueue definition type WorkQueue struct { getStatus chan WorkQueueStatus newlist chan *list.List // Workers get work items by reading from this channel. NextItem <-chan interface{} - // Each worker must send struct{}{} to ReportDone exactly once + // Each worker must send struct{}{} to DoneItem exactly once // for each work item received from NextItem, when it stops // working on that item (regardless of whether the work was // successful). - ReportDone chan<- struct{} + DoneItem chan<- struct{} } +// WorkQueueStatus reflects the queue status. type WorkQueueStatus struct { InProgress int Queued int @@ -108,10 +110,10 @@ func NewWorkQueue() *WorkQueue { reportDone := make(chan struct{}) newList := make(chan *list.List) b := WorkQueue{ - getStatus: make(chan WorkQueueStatus), - newlist: newList, - NextItem: nextItem, - ReportDone: reportDone, + getStatus: make(chan WorkQueueStatus), + newlist: newList, + NextItem: nextItem, + DoneItem: reportDone, } go func() { // Read new work lists from the newlist channel.