Managing child actors #279
-
I am a noob in rust lang right now.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes it looks correct for setting up the link. However you probably will want to customize the supervision flow by customizing the That will let your supervisor control what happens when the child starts, stops, or fails. This is how you can have the parent manage the child. As it stands, the default behavior is to stop the parent when the child exits (graceful stop, or fail) https://github.com/slawlor/ractor/blob/main/ractor/src/actor/mod.rs#L338C5-L352C6 |
Beta Was this translation helpful? Give feedback.
Yes it looks correct for setting up the link. However you probably will want to customize the supervision flow by customizing the
handle_supervisor_evt
method on the supervising actor, in this case theMyFirstActor
.That will let your supervisor control what happens when the child starts, stops, or fails. This is how you can have the parent manage the child.
As it stands, the default behavior is to stop the parent when the child exits (graceful stop, or fail)
https://github.com/slawlor/ractor/blob/main/ractor/src/actor/mod.rs#L338C5-L352C6