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

Add Erlang-inspired process group (pg) scopes #177

Merged
merged 17 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ractor/src/actor/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@
write!(f, "Actor panicked {actor:?} - {panic_msg}")
}
SupervisionEvent::ProcessGroupChanged(change) => {
write!(f, "Process group {} changed", change.get_group())
write!(
f,
"Process group {} in scope {} changed",
change.get_group(),
change.get_scope()
)

Check warning on line 154 in ractor/src/actor/messages.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/messages.rs#L149-L154

Added lines #L149 - L154 were not covered by tests
}
#[cfg(feature = "cluster")]
SupervisionEvent::PidLifecycleEvent(change) => {
Expand Down
3 changes: 3 additions & 0 deletions ractor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ pub type ActorName = String;
/// A process group's name, equivalent to an [Erlang `atom()`](https://www.erlang.org/doc/reference_manual/data_types.html#atom)
pub type GroupName = String;

/// A scope's name, equivalent to an [Erlang `atom()`](https://www.erlang.org/doc/reference_manual/data_types.html#atom)
pub type ScopeName = String;

/// Represents the state of an actor. Must be safe
/// to send between threads (same bounds as a [Message])
pub trait State: std::any::Any + Send + 'static {}
Expand Down
Loading
Loading