Skip to content

Allow Supervisors to be stopped#48

Open
hoodie wants to merge 5 commits into
sunli829:masterfrom
hoodie:feature/lifecycle
Open

Allow Supervisors to be stopped#48
hoodie wants to merge 5 commits into
sunli829:masterfrom
hoodie:feature/lifecycle

Conversation

@hoodie

@hoodie hoodie commented Oct 10, 2021

Copy link
Copy Markdown
Contributor

Hi there,
as described in #27 it would be really nice if Supervisors could be stopped.
I would like to propose to add the .stop_supervisor() method to Addr and Context to achieve this.
In this PR I did the following.

  1. add another ActorEvent called ActorEvent::StopSupervisor which is ignored by normal Actors but obeyed by Supervisors.
    You can now call .stop() to stop the Actor (which will lead to a restart by the supervisor) and .stop_supervisor() which will also stop the Actor but inform the Supervisor to not restart.
  2. Modify the existing example/supervisor_clear_interval.rs
  3. also: I noticed that the Supervisor::start method looked very similar to the Actor::start implementation and since there was already the ActorManager I opted to move them both into the same thing. I took the liberty of renaming it to lifecycle, as the name maybe a bit more familiar.

this fixes #27

Thank you

@hoodie hoodie changed the title Feature/lifecycle Allow Supervisors to bestopped Oct 10, 2021
@hoodie hoodie changed the title Allow Supervisors to bestopped Allow Supervisors to be stopped Oct 10, 2021
@hoodie

hoodie commented Oct 11, 2021

Copy link
Copy Markdown
Contributor Author

@sunli829 what do you think?

@hoodie

hoodie commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

@sunli829 friendly ping

@hoodie

hoodie commented Jan 21, 2022

Copy link
Copy Markdown
Contributor Author

@sunli829 another friendly ping, I know these pass unnoticed sometimes on github.
If you're not interested in this crate anymore, I'd be willing to take over maintainership btw.

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.

Supervisors cannot be stopped (formerly "Supervisor causes panic")

1 participant