Abstract the flow control in queue.close().