onStop

open fun ShutdownContext<S, I, A>.onStop(e: Exception?)

Invoked when Store.close is invoked.

  • This is called after the store is already closed, and you cannot influence the outcome.

  • This is invoked for both exceptional stops and normal stops.

  • Will not be invoked when an Error is thrown.

Warning:

This function is called in an undefined coroutine context on a random thread, when the pipeline is already canceled. It should be fast and non-blocking.

Parameters

e

the exception the store is closed with. Can be null for normal completions. For everything except kotlinx.coroutines.CancellationExceptions, will not be null.