next Event
Suspends until the next event of type T matching predicate is posted, then resumes with that event.
The handler is registered synchronously inside the coroutine body before the first suspension point. In a kotlinx.coroutines.runBlocking + kotlinx.coroutines.launch context, use kotlinx.coroutines.Dispatchers.Unconfined to ensure the coroutine body executes and registers the subscription before any event is posted. In a real coroutine scope that is already running, no special dispatcher is needed.
val packet = bus.nextEvent<PacketReceived>()
val packet = bus.nextEvent<PacketReceived> { it.bytes.size > 100 }Parameters
Dispatch priority; defaults to Priority.NORMAL.
Filter applied to incoming events; defaults to always true.
Suspends until the next event of type T matching predicate is posted on this TypedEventBus, then resumes with that event.
Parameters
Dispatch priority; defaults to Priority.NORMAL.
Filter applied to incoming events; defaults to always true.