Dispatch

sealed interface Dispatch

What an EventRouter does with an event: the answer of a DispatchStrategy.

Replace and WaitFor name events from the list the strategy was given. The router finds their runs by equality, so naming an event names every active run of an event equal to it. An event that is no longer active is skipped.

Inheritors

Types

Link copied to clipboard
data object Ignore : Dispatch

Do not run the event.

Link copied to clipboard
data class Replace(val events: List<UiEvent>) : Dispatch

Cancel the runs of events, then run the event. A run that was still waiting is cancelled before it starts. With no events it is the same as Run.

Link copied to clipboard
data object Run : Dispatch

Run the event now, next to whatever else is active.

Link copied to clipboard
data class WaitFor(val events: List<UiEvent>) : Dispatch

Run the event once the runs of events have ended, whether they ended well, failed or were cancelled. With no events it is the same as Run.