Reputation: 170745
In kotlinx.coroutines 0.19, actor
returns ActorJob
which can be join
ed:
val myActor = actor<...> { ... }
...
myActor.join()
In 0.20, it's changed to return SendChannel
. Looking at the implementation, it does still return an instance of a class which extends Job
, so I could write
...
(myActor as Job).join()
but this is an obvious code smell. Is there a better alternative?
Upvotes: 1
Views: 435
Reputation: 170745
What I ended up doing is creating a Channel
and then separately launch
ing a Job
iterating over this channel.
Upvotes: 1