- Implemented `shutdownAllQueues()`
- Calling `stop()` now shuts down all queues
This commit is contained in:
Tristan B. Velloza Kildaire 2023-11-26 19:09:46 +02:00
parent 08757f27f2
commit 31f7b6355f
1 changed files with 25 additions and 1 deletions

View File

@ -96,9 +96,33 @@ public class Manager
*/
public void stop()
{
/* Stop the watcher */
watcher.shutdown();
// TODO: Unblock ALL queues here
/* Unblock all `dequeue()` calls */
shutdownAllQueues();
}
/**
* Shuts down all registered queues
*/
protected void shutdownAllQueues()
{
/* Lock the queue of queues */
queuesLock.lock();
/* On return or error */
scope(exit)
{
/* Unlock the queue of queues */
queuesLock.unlock();
}
/* Shutdown each queue */
foreach(Queue queue; this.queues)
{
queue.shutdownQueue(ErrorType.MANAGER_SHUTDOWN);
}
}
/**