What is the difference between the PidLifecycleEvent enum and the GroupChangeMessage enum ? #169
-
I see that the comments for these two enums are very similar: /// Represents a change in group or scope membership Do PidLifecycleEvent have any relation to the lifecycle of remote actors? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Yeah that's a bad copy-paste comment on my part. I'll update it. A Group changes are updates from |
Beta Was this translation helpful? Give feedback.
-
// setup PID monitoring |
Beta Was this translation helpful? Give feedback.
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
which will set the
ActorRef<_>
"myself" as a callback target for PID lifecycle events.