Another idea which pops in my mind is to use the a...
# coroutines
c
Another idea which pops in my mind is to use the actor model, send methods and use reflection to invoke them inside the worker, but all in all, if wonder if my thoughts are sane and if I am taking the right path. I like more the idea of submitting a task rather than a message with a "type" which leads to an implementation called by the worker @gildor @elizarov
e
There is no need for reflection. Use the lambda capture, Luke.
E.g.:
Copy code
class MyActor {
    fun operation(params) = act { ... code here ... }
}
Where
act
is a higher-order function that captures the corresponding code and executes it in the actor’s context.
👍 1
c
So do you suggest passing the whole lambda through the channel? I didn't quite get it.
e
Yes
👍 1