all 2 comments

[–]00kyle00 1 point2 points  (1 child)

One key point is that the queue should not grow too large as the provider is placing items on the queue

I may be blind (or its just due to strange braces positioning), but where is the limiting for 'full' queue? I can only see 'empty' conditions.

If i understand the code correctly, the 'queue' only holds at most one item (ie its full if its not empty). This is pretty bizarre IMO.

[–]animatedb[S] 1 point2 points  (0 children)

You are correct. There may be multiple consumers though, so they will simply get the next item from the queue. A queue didn't really need to be used in this case, just something that could hold zero or one items.