Initiates an orderly shutdown.
If processRemainingWorkItems
is true, waits for all active items to finish execution before returning, otherwise returns
immediately after removing all non active items from the queue.
Parameters: processRemainingWorkItems -