https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

Justin

11/14/2019, 5:50 AM
So if actors are obsolete, what should I be using in their place? Or am I missing something?
o

octylFractal

11/14/2019, 6:07 AM
iirc only
actor {}
in particular is, no replacement yet
p

Pablichjenkov

11/14/2019, 6:22 AM
An actor is basically a wrapper over a message queue. Have a wrapper class over a Channel and consumeEach {}
o

octylFractal

11/14/2019, 6:24 AM
yes, equivalent "non-obsolete" code is probably something like
receive { channel.consumeEach { ... } }
m

Matej Drobnič

11/14/2019, 6:32 AM
Wait, why are they obsolete?
o

octylFractal

11/14/2019, 6:33 AM
p

Pablichjenkov

11/14/2019, 6:45 AM
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

Justin

11/14/2019, 3:07 PM
interesting, thanks!
b

bdawg.io

11/14/2019, 4:01 PM
I would be surprised if they ultimately remove simple actors
6 Views