You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing with Proto.Actor and I'm trying to use a supervisor for a child actor, but it isn't been invocated, do you know what could be my issue?
A bit of context, I'm creating a Actor A from ActorSystem without supervisor, then the Actor A will spawn an Actor B with a supervisor.
When the Actor B is failing my supervisor isn't been invoked.
My main class
varsystem=newActorSystem();varprops=Props.FromProducer(()=>newSocketActor());
...var actor =system.Root.Spawn(props);system.Root.Send(actor,newSocketAccepted(socket));
Socket Actor
publicclassSocketActor:IActor{publicasyncTaskReceiveAsync(IContextcontext){if(context.Messageis not SocketAcceptedsocketAccepted){return;}
...var props =Props.FromProducer(()=>newProcessActor()).WithChildSupervisorStrategy(newOneForOneStrategy((_,exception)=>{Console.WriteLine("Error: {0}",exception);returnSupervisorDirective.Restart;},3,TimeSpan.FromSeconds(1)));varactor=context.SpawnNamed(props,"json-serializer");context.Send(actor,newSocketReceived(buffer));}}
The ProcessActor
publicclassProcessActor:IActor{publicTaskReceiveAsync(IContextcontext){if(context.Messageis not SocketReceivedsocketReceived){returnTask.CompletedTask;}varjson=JsonSerializer.Deserialize<Sample>(socketReceived.Data)!;Console.WriteLine("Received sample with id: {0} and name: {1}",json.Id,json.Name);returnTask.CompletedTask;}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello folks,
I'm playing with
Proto.Actor
and I'm trying to use a supervisor for a child actor, but it isn't been invocated, do you know what could be my issue?A bit of context, I'm creating a Actor A from
ActorSystem
without supervisor, then the Actor A will spawn an Actor B with a supervisor.When the Actor B is failing my supervisor isn't been invoked.
My main class
Socket Actor
The ProcessActor
Beta Was this translation helpful? Give feedback.
All reactions