SyncEventMessenger
Synchronous messenger for generic events. It allows event publishing and also handles the subscription of event listeners.
Important: This is a Public Preview API. It may be changed or removed at any time.
Constructors
Functions
Link copied to clipboard
Registers EventListener which will be notified about published events.
Link copied to clipboard
Unregisters the given EventListener.
Extensions
Link copied to clipboard
Waits till provided event appears in the EventChannel
Link copied to clipboard
fun <T : Event> EventChannel<T>.registerOneShotListener(filter: (T) -> Boolean = { true }, block: (T) -> Unit): AutoCloseable
Registers EventListener that will be called only one time and only when given condition is met. Optional filter can be used to make the listener triggered only for certain events based on provided criteria. By default, all events are accepted. Once the listener is triggered, it will remove itself from this EventChannel automatically.