AsyncEvent
The same as Event but with additional async collectors (via a flow). This allows you to listen to the event asynchronously in a totally different CoroutineScope, and unregister via cancellation of that scope. To create an event of this type, have a look at the Event.syncAsync and Event.syncAsyncImmutable functions.
Properties
The scope used for emitting events without blocking the current execution.
The listeners added by listen, sorted by EventPriority via the index in the outer list.
The listeners added by monitor.
Functions
Listens to this event. The callback will always be called synchronously. This function is synchronized, so it may be called from any thread.
Monitors this event. This is the same as listen, but you do not have access to the mutable functions of the event scope. This callback will be executed after EventPriority.LAST, therefore monitor sees the final state.