Skip to content

Commit

Permalink
Merge pull request #5172 from Aaronontheweb/remote/RemoteActorRefProv…
Browse files Browse the repository at this point in the history
…ider-cleanup

minor cleanup to RemoteActorRefProvider
  • Loading branch information
Aaronontheweb committed Aug 6, 2021
1 parent 7f751f3 commit 00a8517
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions src/core/Akka.Remote/RemoteActorRefProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ protected virtual IInternalActorRef CreateRemoteRef(ActorPath actorPath, Address
}

/// <summary>
/// Used to create <see cref="RemoteActoRef"/> instances upon remote deployment to another <see cref="ActorSystem"/>.
/// Used to create <see cref="RemoteActorRef"/> instances upon remote deployment to another <see cref="ActorSystem"/>.
/// </summary>
/// <param name="props">Props of the remotely deployed actor.</param>
/// <param name="supervisor">A reference to the local parent actor responsible for supervising the remotely deployed one.</param>
Expand Down Expand Up @@ -552,7 +552,7 @@ public IActorRef ResolveActorRef(string path)
/// <returns>An <see cref="IActorRef"/> if a match was found. Otherwise nobody.</returns>
public IActorRef InternalResolveActorRef(string path)
{
if (path == String.Empty)
if (path == string.Empty)
return ActorRefs.NoSender;

if (ActorPath.TryParse(path, out var actorPath))
Expand Down Expand Up @@ -586,10 +586,10 @@ public IActorRef ResolveActorRef(ActorPath actorPath)
}

/// <summary>
/// TBD
/// Used to translate an incoming address into an external one
/// </summary>
/// <param name="address">TBD</param>
/// <returns>TBD</returns>
/// <param name="address">The incoming address</param>
/// <returns>The remote Address, if applicable. If not applicable <c>null</c> may be returned.</returns>
public Address GetExternalAddressFor(Address address)
{
if (HasAddress(address)) { return _local.RootPath.Address; }
Expand Down Expand Up @@ -641,7 +641,7 @@ public void Quarantine(Address address, int? uid)
/// All of the private internals used by <see cref="RemoteActorRefProvider"/>, namely its transport
/// registry, remote serializers, and the <see cref="RemoteDaemon"/> instance.
/// </summary>
class Internals : INoSerializationVerificationNeeded
private class Internals : INoSerializationVerificationNeeded
{
/// <summary>
/// TBD
Expand Down Expand Up @@ -679,7 +679,7 @@ public Internals(RemoteTransport transport, Akka.Serialization.Serialization ser
/// <summary>
/// Describes the FSM states of the <see cref="RemotingTerminator"/>
/// </summary>
enum TerminatorState
private enum TerminatorState
{
/// <summary>
/// TBD
Expand Down Expand Up @@ -773,14 +773,7 @@ private void InitFSM()
public sealed class TransportShutdown
{
private TransportShutdown() { }
private static readonly TransportShutdown _instance = new TransportShutdown();
public static TransportShutdown Instance
{
get
{
return _instance;
}
}
public static TransportShutdown Instance { get; } = new TransportShutdown();

public override string ToString()
{
Expand All @@ -800,18 +793,16 @@ public RemoteDeadLetterActorRef(IActorRefProvider provider, ActorPath actorPath,

protected override void TellInternal(object message, IActorRef sender)
{
var send = message as EndpointManager.Send;
var deadLetter = message as DeadLetter;
if (send != null)
if (message is EndpointManager.Send send)
{
if (send.Seq == null)
{
base.TellInternal(send.Message, send.SenderOption ?? ActorRefs.NoSender);
}
}
else if (deadLetter?.Message is EndpointManager.Send)
else if (deadLetter?.Message is EndpointManager.Send deadSend)
{
var deadSend = (EndpointManager.Send)deadLetter.Message;
if (deadSend.Seq == null)
{
base.TellInternal(deadSend.Message, deadSend.SenderOption ?? ActorRefs.NoSender);
Expand Down

0 comments on commit 00a8517

Please sign in to comment.