void RunProcessDirective( ProcessId pid, ProcessId sender, Exception e, object message, StrategyDecision decision, bool unPauseAfterRestart ) { var directive = decision.ProcessDirective; // Find out the processes that this strategy affects and apply foreach (var cpid in decision.Affects.Filter(x => x != pid)) { switch (directive.Type) { case DirectiveType.Escalate: case DirectiveType.Resume: // Note: unpause probably won't do anything if unPauseAfterRestart==false because our strategy did not pause them (but unpause should not harm) unpause(cpid); break; case DirectiveType.Restart: restart(cpid); break; case DirectiveType.Stop: kill(cpid); break; } } switch (directive.Type) { case DirectiveType.Escalate: tellSystem(Parent.Actor.Id, SystemMessage.ChildFaulted(pid, sender, e, message), Self); break; case DirectiveType.Resume: // Note: unpause should not be necessary if unPauseAfterRestart==false because our strategy did not pause before (but unpause should not harm) unpause(pid); break; case DirectiveType.Restart: Restart(unPauseAfterRestart); break; case DirectiveType.Stop: ShutdownProcess(false); break; } }
void RunProcessDirective( ProcessId pid, ProcessId sender, Exception e, object message, StrategyDecision decision ) { var directive = decision.ProcessDirective; // Find out the processes that this strategy affects and apply foreach (var cpid in decision.Affects.Filter(x => x != pid)) { switch (directive.Type) { case DirectiveType.Escalate: case DirectiveType.Resume: unpause(cpid); break; case DirectiveType.Restart: restart(cpid); break; case DirectiveType.Stop: kill(cpid); break; } } unpause(pid); switch (directive.Type) { case DirectiveType.Escalate: tellSystem(Parent.Actor.Id, SystemMessage.ChildFaulted(pid, sender, e, message), Self); break; case DirectiveType.Resume: // Do nothing break; case DirectiveType.Restart: Restart(); break; case DirectiveType.Stop: ShutdownProcess(false); break; } }