mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-30 21:04:48 +00:00
Merge pull request #666 from PepperDash/hotfix/generic-queue-disposed-check
added a Disposed check and Debug Message to prevent enqueing messages…
This commit is contained in:
@@ -199,6 +199,12 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
|
||||
public void Enqueue(IQueueMessage item)
|
||||
{
|
||||
if (Disposed)
|
||||
{
|
||||
Debug.Console(1, this, "I've been disposed so you can't enqueue any messages. Are you trying to dispatch a message while the program is stopping?");
|
||||
return;
|
||||
}
|
||||
|
||||
_queue.Enqueue(item);
|
||||
_waitHandle.Set();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user