Пример #1
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="context">TBD</param>
 /// <param name="restart">TBD</param>
 /// <param name="child">TBD</param>
 /// <param name="cause">TBD</param>
 /// <param name="stats">TBD</param>
 /// <param name="children">TBD</param>
 public override void ProcessFailure(IActorContext context, bool restart, IActorRef child, Exception cause, ChildRestartStats stats, IReadOnlyCollection <ChildRestartStats> children)
 {
     if (restart && stats.RequestRestartPermission(MaxNumberOfRetries, WithinTimeRangeMilliseconds))
     {
         RestartChild(child, cause, suspendFirst: false);
     }
     else
     {
         context.Stop(child);
     }
 }
Пример #2
0
        protected override void ProcessFailure(IActorContext context, bool restart, Exception cause, ChildRestartStats failedChildStats, IReadOnlyCollection <ChildRestartStats> allChildren)
        {
            var failedChild = failedChildStats.Child;

            if (restart && failedChildStats.RequestRestartPermission(MaxNumberOfRetries, WithinTimeRangeMilliseconds))
            {
                RestartChild(failedChild, cause, suspendFirst: false);
            }
            else
            {
                context.Stop(failedChild);
            }
        }