Skip to content
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

Move Context::stop_all to Address::stop_all #118

Closed
wants to merge 4 commits into from

Conversation

thomaseizinger
Copy link
Collaborator

Stopping all actors is equivalent to sending a Stop message to
each actor. Sending messages is done on an Address. Thus stopping
all actors should be done on an Address too.

@thomaseizinger thomaseizinger linked an issue Jul 11, 2022 that may be closed by this pull request
Base automatically changed from remove-attach-context to master July 14, 2022 00:51
Stopping all actors is equivalent to sending a `Stop` message to
each actor. Sending messages is done on an `Address`. Thus stopping
all actors should be done on an `Address` too.
`stop_all` does not exist in `0.5.2` and thus this changelog entrry
does not make any sense here.
@Restioson
Copy link
Owner

Given the current conclusion in #119, do you still think we should move this, or no?

@thomaseizinger
Copy link
Collaborator Author

Given the current conclusion in #119, do you still think we should move this, or no?

I will need to think about it a bit but I still find this to be somewhat more natural on Address yes.

@Restioson
Copy link
Owner

I will need to think about it a bit but I still find this to be somewhat more natural on Address yes.

The main thing IMO is that it's a bit odd to have stop be only on Context, but stop_all only on Address. I understand why this is, but it's a bit strange. The other thing is that it changes the encapsulation of the actor a bit. Previously, the only way to shut down an actor from the outside would be to explicitly write a message to do so, or to drop all addresses. Now, there is an additional way, which means that the actor's stopping behaviour is no longer uniquely controlled by the actor itself anymore. I would say that dropping all addresses is an exception to this rule as this is not generally a part of control flow but more about liveness.

@thomaseizinger
Copy link
Collaborator Author

I agree for it to remain on Context.

@thomaseizinger thomaseizinger deleted the move-stop-all branch August 2, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Context::stop_all to Address
2 participants