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

asad.awadia

03/22/2019, 2:25 AM
What is the difference between actor model and fan out from the guide? https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/channels.md#fan-out
o

octylFractal

03/22/2019, 2:27 AM
actor
is the opposite direction, right? it receives objects, instead of sending them
a

asad.awadia

03/22/2019, 2:32 AM
Right - so the actors == worker coroutines from fan out model?
o

octylFractal

03/22/2019, 2:41 AM
sort of, but there's only one of them -- you can't add more
r

r4zzz4k

03/22/2019, 7:08 AM
I'd say actor is an opposite to fan-out in a sense that it can be used as a fan-in -- you send messages to it asynchronously, from different contexts, and it processes them serially.
It's basically a channel with a coroutine consuming from it attached.
2 Views