``` class Echo : Actor<Any> { fun tick()...
# coroutines
j
Copy code
class Echo : Actor<Any> {
    fun tick() {
        val ctx = inbox.await()
        reply(ctx, ctx.msg)
    }

    fun run() {
        while (true) {
            tick()
        }
    }
}


// Or
fun echo() = actor { it -> 
    while (true) {
        val ctx = it.await()
        it.reply(ctx, ctx.msg)
    }
}