Skip to content

Commit

Permalink
Add OverrideReceiver to AkkaReceiverNotificationChannel.
Browse files Browse the repository at this point in the history
  • Loading branch information
veblush committed Jul 13, 2016
1 parent 453a82c commit eb33d26
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion core/Akka.Interfaced/AkkaReceiverNotificationChannel.cs
Expand Up @@ -4,7 +4,7 @@ namespace Akka.Interfaced
{
public class AkkaReceiverNotificationChannel : INotificationChannel
{
public ICanTell Receiver { get; }
public ICanTell Receiver { get; private set; }

private int _lastNotificationId;

Expand Down Expand Up @@ -38,5 +38,19 @@ public override int GetHashCode()
{
return Receiver.GetHashCode();
}

public static bool OverrideReceiver(INotificationChannel channel, ICanTell receiver)
{
var akkaChannel = channel as AkkaReceiverNotificationChannel;
if (akkaChannel != null)
{
akkaChannel.Receiver = receiver;
return true;
}
else
{
return false;
}
}
}
}

0 comments on commit eb33d26

Please sign in to comment.