private void FaultResume(Exception causedByFailure)
{
if (_actor == null)
{
_systemImpl.EventStream.Publish(new Error(null, _self.Path.ToString(), GetType(), "Changing Resume into Create after " + causedByFailure));
FaultCreate();
}
//Akka Jvm does the following commented section as well, but we do not store the context inside the actor so it's not applicable
// else if (_actor.context == null && causedByFailure != null)
// {
// system.eventStream.publish(Error(self.path.toString, clazz(actor), "changing Resume into Restart after " + causedByFailure))
// faultRecreate(causedByFailure)
// }
else
{
var perp = Perpetrator;
// done always to keep that suspend counter balanced
// must happen "atomically"
try
{
ResumeNonRecursive();
}
finally
{
if (causedByFailure != null)
ClearFailed();
}
ResumeChildren(causedByFailure, perp);
}
}