Closed Arttii closed 12 months ago
Sorry for late response here. No, there is no way to apply supervision for grains. or have any type of parent-child relation between grains. Grains are fully managed by the IdentityLookupProvider used, eg. disthash.
Hi,
I was wondering if it's possible to start several children in a grain, which themselves are grain. I am specifically wondering if there is a parent child supervision type mechanism when using grains in this way.
The background is that I am starting several grains, but a parent grain drives them. In case that shuts down, I would like to propagate the shutdown to the children. I am doing this because in one case the actors are indeed grains and will run somewhere in the cluster, but in a specific case it's desirable for them to run together and be supervised by one parent actor.
Is there away to do this, or should I implement everything as direct actors instead? Thanks!
EDIT:
It seems if I do something like this:
From the parent grain, where
getNamespacedGrainGrainClient
resolved the client to the same identity, then i can force the grain to run as a child of the parent grain.Is this an anti-pattern?