-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Coroutines launched in actor are not getting cancelled when we close the actor channel #836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Closing the channel just breaks the Did you try closing the channel with an exception? |
so there is no direct way to signal the actor to close the channel and cancel all associated coroutines? |
Maybe if you close the channel with an exception, I haven't tried that but it should propagate the exception (cancelling children coroutines). |
UPDATE: Please unsee this comment.
|
Would be a good thing to take into account for #485 (I didn't try to make much sense of that yet, I'm still learning about the actors concept itself) |
Here is the actual explanation: Closing the actor's channel (invoking |
but what if we want to signal actor ("your work no longer needed(not failed) -- abort everything"). |
The example of how to do it is written in the KDoc to
But this is a bit verbose and error-prone, in #87 we will address this issue properly |
as the title says. if I launch a coroutine in actor and when I close the channel of the actor, coroutine not getting cancelled.
if coroutine inherit the actorscope should not they be cancelled if the channel associated with it, sends the close signal.
The text was updated successfully, but these errors were encountered: