Skip to content

Commit

Permalink
fix null refs
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing committed Oct 26, 2023
1 parent 7e733da commit 20af461
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Proto.Actor/Context/ActorContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ private Task HandleProcessDiagnosticsRequest(ProcessDiagnosticsRequest processDi

processDiagnosticsRequest.Result.SetResult(diagnosticsString);

return default;
return Task.CompletedTask;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down Expand Up @@ -555,7 +555,7 @@ private Task InternalInvokeUserMessageAsync(object msg)
_extras?.ResetReceiveTimeoutTimer(ReceiveTimeout);
}

return default;
return Task.CompletedTask;
}

return Await(this, t, influenceReceiveTimeout);
Expand Down Expand Up @@ -725,7 +725,7 @@ private Task HandleUnwatch(Unwatch uw)
{
_extras?.Unwatch(uw.Watcher);

return default;
return Task.CompletedTask;
}

private Task HandleWatch(Watch w)
Expand All @@ -739,7 +739,7 @@ private Task HandleWatch(Watch w)
EnsureExtras().Watch(w.Watcher);
}

return default;
return Task.CompletedTask;
}

private Task HandleFailureAsync(Failure msg)
Expand Down Expand Up @@ -790,7 +790,7 @@ private Task HandleStopAsync()
if (_state >= ContextState.Stopping)
{
//already stopping or stopped
return default;
return Task.CompletedTask;
}

_state = ContextState.Stopping;
Expand All @@ -814,7 +814,7 @@ static async Task Await(ActorContext self)
}
}

private ValueTask StopAllChildren()
private Task StopAllChildren()
{
if (_extras != null)
{
Expand All @@ -829,11 +829,11 @@ private ValueTask StopAllChildren()

//intermediate stopping stage, waiting for children to stop
//this is directly triggered by StopAllChildren, or by Terminated messages from stopping children
private ValueTask TryRestartOrStopAsync()
private Task TryRestartOrStopAsync()
{
if (_extras?.Children.Count > 0)
{
return default;
return Task.CompletedTask;
}

CancelReceiveTimeout();
Expand All @@ -843,12 +843,12 @@ private ValueTask TryRestartOrStopAsync()
{
ContextState.Restarting => RestartAsync(),
ContextState.Stopping => FinalizeStopAsync(),
_ => default
_ => Task.CompletedTask
};
}

//Last and final termination step
private async ValueTask FinalizeStopAsync()
private async Task FinalizeStopAsync()
{
System.ProcessRegistry.Remove(Self);
//This is intentional
Expand All @@ -867,7 +867,7 @@ private async ValueTask FinalizeStopAsync()
_state = ContextState.Stopped;
}

private async ValueTask RestartAsync()
private async Task RestartAsync()
{
await DisposeActorIfDisposable().ConfigureAwait(false);
Actor = IncarnateActor();
Expand Down

0 comments on commit 20af461

Please sign in to comment.