Observer

abstract class Observer<Data, E : Event<Data, E, *>>

Base abstraction for creating event observer types.

Parameters

event

The event being observed.

tag

A string to help grouping/identifying observer(s).

executor

The thread context in which onEvent will be invoked in. If null, the default passed to notify from the Event processor implementation will be utilized.

onEvent

The callback to pass event data to.

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard

A string value for grouping or identifying the observer.

Functions

Link copied to clipboard
fun notify(default: OnEvent.Executor, data: Data)
fun notify(handler: CoroutineContext, default: OnEvent.Executor, data: Data)

Invokes OnEvent with the provided data

Link copied to clipboard
fun toString(isStatic: Boolean): String

Helper for processor implementations as to not expose a static tag externally.