on Action Execution
Add an async interceptor that wraps the action's suspend execution. Runs inside the coroutine — next() suspends until the action completes.
actor.onActionExecution { action, next ->
val start = System.nanoTime()
next() // suspends until the action finishes
val ms = (System.nanoTime() - start) / 1_000_000
println("${action::class.simpleName} took ${ms}ms")
}Content copied to clipboard