Taking 100 elements from a queue with fallback option
Hi!
I want to take 100 elements from a queue and if there are no N elements in the queue after 1 second, I want to fall back to taking up to 100. Here is my code:
output:
queue size 111
queue size after taking 100 elements 11
queue size after timeout 0
I would expect the queue size to be 11 after the first timeout. Why is it 0? And how can I achieve such behavior?
I want to take 100 elements from a queue and if there are no N elements in the queue after 1 second, I want to fall back to taking up to 100. Here is my code:
output:
queue size 111
queue size after taking 100 elements 11
queue size after timeout 0
I would expect the queue size to be 11 after the first timeout. Why is it 0? And how can I achieve such behavior?
