C# Класс 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.
Наследование: Akka.Actor.UntypedActor
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
Add void
Buffer void
CancelTimer void
CreateIdentifyId string
HandleInitial void
IdentifySingleton void
MatchingRole bool
Remove void
SendBuffered void
TrackChanges void

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
OnReceive ( object message ) : void
PostStop ( ) : void
PreStart ( ) : void

Приватные методы

Метод Описание
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

Описание методов

ClusterSingletonProxy() публичный Метод

public ClusterSingletonProxy ( string singletonManagerPath, Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings settings ) : System
singletonManagerPath string
settings Akka.Cluster.Tools.Singleton.ClusterSingletonProxySettings
Результат System

DefaultConfig() публичный статический Метод

Returns default HOCON configuration for the cluster singleton.
public static DefaultConfig ( ) : Config
Результат Akka.Configuration.Config

OnReceive() защищенный Метод

protected OnReceive ( object message ) : void
message object
Результат void

PostStop() защищенный Метод

protected PostStop ( ) : void
Результат void

PreStart() защищенный Метод

protected PreStart ( ) : void
Результат void

Props() публичный статический Метод

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.
Результат Props