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

napperley

03/10/2020, 1:52 AM
What is the current status of the Actor API in the KotlinX Coroutines library? I have a program (Industrial software that behaves like a Linux Daemon) running in production that heavily relies on the API, and would very likely break if a newer version of the KotlinX Coroutines library is used.
z

Zach Klippenstein (he/him) [MOD]

03/10/2020, 4:15 AM
The
actor
coroutine builder is annotated with
@ObsoleteCoroutinesApi
, so it could change or even disappear in newer versions.
☝️ 1
r

rkeazor

03/10/2020, 4:43 AM
I think it will be replaced by flow in the later versions
n

napperley

03/10/2020, 5:41 AM
That would be very bad news since there is a need to support the Actor concurrency model ( https://en.wikipedia.org/wiki/Actor_model ), which is one of the major concurrency models. Flow is a implementation of the RX concurrency model, which doesn't cover the safe handling of mutable state like Actor does, and doesn't have the concept of supervisors ( https://doc.akka.io/docs/akka/2.5/general/supervision.html ).
z

Zach Klippenstein (he/him) [MOD]

03/10/2020, 5:23 PM
There was a PR a couple years ago proposing a new API for typed actors, but i don’t think there’s been any work on that for a long time. I suspect that would be the replacement though, not Flow.
s

Seri

03/10/2020, 6:31 PM
@napperley I’d recommend reading through the conversation here: https://github.com/Kotlin/kotlinx.coroutines/issues/87
👍 1
3 Views