Maybe a class that implements Handler and has a fu...
# coroutines
d
Maybe a class that implements Handler and has a fun that returns a ProducerJob which sends anything the handler receives?
Or like this?
Copy code
class ProducerHandler<T>(val context: Context): Handler<T> {
	override fun handle(event: T) {
		launch(context.dispatcher()) {
			_channel.send(event)
		}
	}

	private val _channel = Channel<T>()

	val channel: ReceiveChannel<T> = _channel
}