Add flush() method to manually empty the queue.