C# Class Akka.Cluster.Tools.Singleton.ClusterSingletonProxy

The ClusterSingletonProxy works together with the ClusterSingletonManager to provide a distributed proxy to the singleton actor.

The proxy can be started on every node where the singleton needs to be reached and used as if it were the singleton itself. It will then act as a router to the currently running singleton instance. If the singleton is not currently available, e.g., during hand off or startup, the proxy will buffer the messages sent to the singleton and then deliver them when the singleton is finally available. The size of the buffer is configurable and it can be disabled by using a buffer size of 0. When the buffer is full old messages will be dropped when new messages are sent via the proxy.

The proxy works by keeping track of the oldest cluster member. When a new oldest member is identified, e.g. because the older one left the cluster, or at startup, the proxy will try to identify the singleton on the oldest member by periodically sending an Identify message until the singleton responds with its ActorIdentity.

Note that this is a best effort implementation: messages can always be lost due to the distributed nature of the actors involved.
Inheritance: Akka.Actor.UntypedActor
Mostra file Open project: rogeralsing/akka.net

Private Properties

Property Type Description
Add void
Buffer void
CancelTimer void
CreateIdentifyId string
HandleInitial void
IdentifySingleton void
MatchingRole bool
Remove void
SendBuffered void
TrackChanges void

Public Methods

Method Description
ClusterSingletonProxy ( string singletonManagerPath, Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings settings ) : System
DefaultConfig ( ) : Config

Returns default HOCON configuration for the cluster singleton.

Props ( string singletonManagerPath, Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings settings ) : Props

Faactory method for ClusterSingletonProxy Actor.Props.

Protected Methods

Method Description
OnReceive ( object message ) : void
PostStop ( ) : void
PreStart ( ) : void

Private Methods

Method Description
Add ( Member member ) : void
Buffer ( object message ) : void
CancelTimer ( ) : void
CreateIdentifyId ( int i ) : string
HandleInitial ( ClusterEvent state ) : void
IdentifySingleton ( ) : void
MatchingRole ( Member member ) : bool
Remove ( Member member ) : void
SendBuffered ( ) : void
TrackChanges ( System.Action block ) : void

Method Details

ClusterSingletonProxy() public method

public ClusterSingletonProxy ( string singletonManagerPath, Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings settings ) : System
singletonManagerPath string
settings Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings
return System

DefaultConfig() public static method

Returns default HOCON configuration for the cluster singleton.
public static DefaultConfig ( ) : Config
return Akka.Configuration.Config

OnReceive() protected method

protected OnReceive ( object message ) : void
message object
return void

PostStop() protected method

protected PostStop ( ) : void
return void

PreStart() protected method

protected PreStart ( ) : void
return void

Props() public static method

Faactory method for ClusterSingletonProxy Actor.Props.
public static Props ( string singletonManagerPath, Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings settings ) : Props
singletonManagerPath string /// The logical path of the singleton manager, e.g. `/user/singletonManager`, /// which ends with the name you defined in `actorOf` when creating the . ///
settings Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings Cluster singleton proxy settings.
return Props