Option to empty the queue?
See original GitHub issueHi and thanks for this awesome library.
I was wonder if I can empty this._queue
somehow. In my app I manage a queue of actions, but sometimes I just want to empty it all out when a drastic event happens (and the old queue is not relevant anymore).
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How do I clear the std::queue efficiently? - c++ - Stack Overflow
In one scenario, I want to clear the queue in one shot( delete all jobs from the queue). I don't see any clear...
Read more >empty() and queue::size() in C++ STL - GeeksforGeeks
Application : Given a queue of integers, find the sum of the all the integers. ... Algorithm 1. Check if the queue is...
Read more >How to Clear Your Spotify Queue - Alphr
Here's how you can clear the Spotify queue using Windows and Mac: Open the Spotify app. Click on the Queue button located in...
Read more >How to empty a queue with 200+ messages?
Hi all, We are using Solace in combination with Boomi. We're looking for a solution to empty a queue quickly. No matter how...
Read more >How do I purge a queue - ActiveMQ
Another option is to use JMX to browse the queues and call the purge() method on the QueueViewMBean. You could also delete the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have released version 0.3.0 on NPM. This now includes a
cancel()
method on mutexes and semaphores that will reject all pending locks. The currently held lock is not affected, though, so the mutex will still be locked until the current lock is released.But that’s not possible. Once a “task” has acquired the mutex, there’s no way to stop it — what we just called a “task” is really just a sequence of async execution steps that are scheduled on the event loop (and that hopefully do release the mutex eventually). There is no further interaction with the mutex before it is released in which we could throw.
I think the only thing possible is to reject the promises for all pending locks, and to wait until the current holder of the mutex releases it.