EngineLifecycle

The lifecycle allows plugins to subscribe to events such as engine and context configuration.

Lifecycle events are part of a sealed hierarchy of singletons that act as type-safe event keys, and can be used as follows:

lifecycle.on(EngineLifecycleEvent.ContextCreated) { it: ContextBuilder ->
// update the context builder before it is handed back to the engine
it.option(...)
}

Functions

Link copied to clipboard
abstract fun <T> on(event: EngineLifecycleEvent<T>, consume: (T) -> Unit)