onUndeliveredIntent

open fun ShutdownContext<S, I, A>.onUndeliveredIntent(intent: I)

Called when an intent is not delivered to the store.

This can happen according to the Channel's documentation:

  • When the store has a limited buffer and it overflows.

  • When store is stopped before this event could be handled, or while it is being handled.

  • When the onIntent function throws an exception that is not handled by the onException block.

  • When the store is stopped and there were intents in the buffer, in which case, onUndeliveredIntent will be called on all of them.

Warning:

This function is called in an undefined coroutine context on a random thread, while the store is running or already stopped. It should be fast, non-blocking, and must not throw exceptions, or the store will crash. The onException block will not handle exceptions in this function.