@Suspendable open static fun <T : Any> awaitEvent(consumer: Consumer<Handler<T>>): T
Receive a single event from a handler synchronously. The fiber will be blocked until the event occurs. No kernel thread is blocked.
consumer - this should encapsulate the setting of the handler to receive the event. The handler is passed to it.
Return
the event
@Suspendable open static fun <T : Any> awaitEvent(consumer: Consumer<Handler<T>>, timeout: Long): T
Receive a single event from a handler synchronously. The fiber will be blocked until the event occurs. No kernel thread is blocked.
consumer - this should encapsulate the setting of the handler to receive the event. The handler is passed to it.
timeout - In milliseconds when to cancel the awaited event
Return
the event