Skip to content

How to properly clean up multiple levels of spawned actors? #1558

Answered by Andarist
ezhikov asked this question in Q&A
Discussion options

You must be logged in to vote

I wonder, if I should stop every actor from the very bottom (with passing a message, perhaps?), cleanup context, then go level up and perform same manipulations on another set of actors?

If you want to stop an entire "branch" of actors you only need to stop the one at the top and it will propagate that recursivelyyto all of its descendants.

And, as a side question which could lead me to an easier solution: is it possible to invoke arbitrary amount of child machines? Something like invoke: (ctx, event) => [{src: 'child', src: 'child', src: 'child'}]

It should be possible, although a different syntax might be needed - invoke should accept an array of invoke configs.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ezhikov
Comment options

Answer selected by ezhikov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants