This queue:out/1 case pattern is repeated a number of times. I'd prefer to see a maybe_dequeue_req or similar to tidy that up.