stop

fun stop()(source)

Stops the message queue consumer by gracefully canceling ongoing processes for consumption and fetching.

This method cancels the following in sequence:

  • The channel consumption process (consumeChannel) to stop receiving messages.

  • The message consumption job (consumeJob) responsible for processing messages.

  • The fetching delay job (fetchDelayJob) that controls delays between fetch operations and resets the fetch delay to zero.

  • The fetching job (fetchJob) responsible for retrieving messages from the queue.

Delays are applied during the stopping process to ensure proper shutdown and cleanup of resources.