receive

abstract suspend fun receive(handler: suspend (Event) -> Response)

Install a handler for incoming events. 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.