stop
Stops the message queue consumer, gracefully shutting down all of its jobs and awaiting their completion.
The shutdown proceeds in the following order:
The notification job (
notifyJob) is cancelled so no further insert notifications are processed.The fetching job (
fetchJob) is cancelled first, stopping the consumer from pulling in new work, and the fetch delay is reset to zero.The consume channel is closed so any already-buffered messages are drained (rather than dropped) and the consume job (
consumeJob) is awaited until it finishes processing them.
This method suspends until the shutdown has fully completed, so the caller can rely on the consumer being stopped once it returns. The consumer can be started again afterwards via start.