Skip to content

Commit

Permalink
We should only notify the stop listener AFTER post_stop has execute…
Browse files Browse the repository at this point in the history
…d, which is when the state gets set to `Stopped`

Closes Add a pre_stop fn or some way to wait until post_stop has finished #254
  • Loading branch information
slawlor committed Sep 13, 2024
1 parent 67d657e commit 5a97b73
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ractor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ractor"
version = "0.10.3"
version = "0.10.4"
authors = ["Sean Lawlor", "Evan Au", "Dillon George"]
description = "A actor framework for Rust"
documentation = "https://docs.rs/ractor"
Expand All @@ -19,7 +19,6 @@ cluster = []
tokio_runtime = ["tokio/time", "tokio/rt", "tokio/macros", "tokio/tracing"]
blanket_serde = ["serde", "pot", "cluster"]

# default = ["async-std"]
default = ["tokio_runtime", "async-trait"]

[dependencies]
Expand Down
4 changes: 4 additions & 0 deletions ractor/src/actor/actor_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ impl ActorCell {
// Leave all + stop monitoring pg groups (if any)
crate::pg::demonitor_all(self.get_id());
crate::pg::leave_all(self.get_id());
}

// Fix for #254. We should only notify the stop listener AFTER post_stop
// has executed, which is when the state gets set to `Stopped`.
if status == ActorStatus::Stopped {
// notify whoever might be waiting on the stop signal
self.inner.notify_stop_listener();
}
Expand Down
2 changes: 1 addition & 1 deletion ractor_cluster/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ractor_cluster"
version = "0.10.3"
version = "0.10.4"
authors = ["Sean Lawlor", "Evan Au", "Dillon George"]
description = "Distributed cluster environment of Ractor actors"
documentation = "https://docs.rs/ractor"
Expand Down
2 changes: 1 addition & 1 deletion ractor_cluster_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ractor_cluster_derive"
version = "0.10.3"
version = "0.10.4"
authors = ["Sean Lawlor <seanlawlor@fb.com>"]
description = "Derives for ractor_cluster"
license = "MIT"
Expand Down

0 comments on commit 5a97b73

Please sign in to comment.