Added closed functionality. This allows for escaping from pull functions when no new elements will ever enter the queue.