I have a scenario where I need to remove an item for the queue as soon as been processed. I understand I cannot remove an item from a collection whilst in loop but was wond
To me, it looks like you are trying to process the element in queue one-by-one.
How about wrapping this in while loop and process each element from Dequeue, until the queue is empty?
while