Currently, the only way to stop the worker thread is to call dispose(boolean force):
dispose(true) interrupts the worker thread to immediately stop execution.
dispose(false) if there is an event listener currently executing, the thread will exit after the listener returns.
Proposed:
1) Add a soft shutdown method that will cause the work queue to reject all new items, and cause the thread to exit once all work queue items have finished executing.
2) Add an option to automatically shut down after a given amount of time has passed without an event being thrown.
From https://github.com/sparklicorn/bucket/issues/15
Shutdown behavior
Currently, the only way to stop the worker thread is to call
dispose(boolean force)
:dispose(true)
interrupts the worker thread to immediately stop execution.dispose(false)
if there is an event listener currently executing, the thread will exit after the listener returns.Proposed:
1) Add a soft shutdown method that will cause the work queue to reject all new items, and cause the thread to exit once all work queue items have finished executing.
2) Add an option to automatically shut down after a given amount of time has passed without an event being thrown.