receiveIn

open fun receiveIn(coroutineScope: CoroutineScope, handler: suspend (Event) -> Response): Job

Install a handler for incoming events in a new coroutine. The handler will be called for each incoming event, and the response returned by the handler will be sent back to the sender of the event.