So if actors are obsolete, what should I be using ...
# coroutines
j
So if actors are obsolete, what should I be using in their place? Or am I missing something?
o
iirc only
actor {}
in particular is, no replacement yet
p
An actor is basically a wrapper over a message queue. Have a wrapper class over a Channel and consumeEach {}
o
yes, equivalent "non-obsolete" code is probably something like
receive { channel.consumeEach { ... } }
m
Wait, why are they obsolete?
o
p
It seems that is risky putting too much effort in creating a full Actor framework just now. Besides some reasonable facts about competence and such. I think making it obsolete is a bit drastic. We cannot run AKKA on Android, at least for Android devs it was useful imo. On another hand this is an example of a class handling a channel actor like styled. https://github.com/pablichjenkov/Android-Actor/blob/master/app/src/main/java/com/hamperapp/actor/Actor.kt
j
interesting, thanks!
b
I would be surprised if they ultimately remove simple actors