Skip to content

What is the difference between the PidLifecycleEvent enum and the GroupChangeMessage enum ? #169

Answered by slawlor
phil-skillwon asked this question in Q&A
Discussion options

You must be logged in to vote

There's a unit test which demonstrates it, called test_pid_lifecycle_monitoring. You need to "enroll" to receiving the callbacks for pid lifecycle events (since there could be hundreds/thousands depending on the architecture of your system). It's a non-trivial event stream to subscribe to.

Specifically you can call what's called in ractor_cluster/src/node_session/mod.rs:665

// setup PID monitoring
ractor::registry::pid_registry::monitor(myself.get_cell());

which will set the ActorRef<_> "myself" as a callback target for PID lifecycle events.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@phil-skillwon
Comment options

@slawlor
Comment options

Answer selected by phil-skillwon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants