RouterTrace

sealed interface RouterTrace<out E : UiEvent>

One thing an EventRouter did with an event, as its RouterObserver is told.

Each event gets a number when the router decides what to do with it, counting from 1 in the order of those decisions. The reports of one event share its number, so two equal events can be told apart and the start of a run can be paired with its end.

Every report prints as a sentence that starts with the number and the event, such as #3 OnQueryChange(query=cat) replaces #2.

Inheritors

Types

Link copied to clipboard
data class Cancelled<out E : UiEvent>(val event: E, val number: Long, val reason: RouterTrace.Cancelled.Reason) : RouterTrace<E>

The run of the event was cancelled, for reason. It may never have started.

Link copied to clipboard
data class Completed<out E : UiEvent>(val event: E, val number: Long) : RouterTrace<E>

The handler of the event returned.

Link copied to clipboard
data class Dispatched<out E : UiEvent>(val event: E, val number: Long, val dispatch: Dispatch, val replacedOrAwaited: List<Long>) : RouterTrace<E>

The strategy of the event's handler answered dispatch. It is the first report of every event, and the only one of an event that is ignored.

Link copied to clipboard
data class EffectEmitted<out E : UiEvent>(val event: E, val number: Long, val effect: UiEffect) : RouterTrace<E>

The handler of the event emitted effect, or the screen's ErrorHandler did while it handled the failure of that event. The report comes at the moment of the emission, so an effect of the error handler is reported before the failure itself.

Link copied to clipboard
data class Failed<out E : UiEvent>(val event: E, val number: Long, val error: Throwable) : RouterTrace<E>

The handler of the event threw error. The screen's ErrorHandler is given the same failure.

Link copied to clipboard
data class Started<out E : UiEvent>(val event: E, val number: Long) : RouterTrace<E>

The handler of the event started. An event that waits for others starts once they have ended.

Properties

Link copied to clipboard
abstract val event: E

The event the report is about.

Link copied to clipboard
abstract val number: Long

The number of event among the events of its router, counting from 1.