ClusterSingletonManager Class |
Manages singleton actor instance among all cluster nodes or a group of nodes tagged with a specific role. At most one singleton instance is running at any point in time.
The ClusterSingletonManager is supposed to be started on all nodes, or all nodes with specified role, in the cluster with ActorOf(Props, String). The actual singleton is started on the oldest node by creating a child actor from the supplied `singletonProps`.
The singleton actor is always running on the oldest member with specified role. The oldest member is determined by IsOlderThan(Member). This can change when removing members. A graceful hand over can normally be performed when current oldest node is leaving the cluster. Be aware that there is a short time period when there is no active singleton during the hand-over process.
The cluster failure detector will notice when oldest node becomes unreachable due to things like CLR crash, hard shut down, or network failure. When the crashed node has been removed (via down) from the cluster then a new oldest node will take over and a new singleton actor is created.For these failure scenarios there will not be a graceful hand-over, but more than one active singletons is prevented by all reasonable means. Some corner cases are eventually resolved by configurable timeouts.
You access the singleton actor with ClusterSingletonProxy. Alternatively the singleton actor may broadcast its existence when it is started.
Use factory method Props(Props, ClusterSingletonManagerSettings) to create the Props for the actor.
Namespace: Akka.Cluster.Tools.Singleton
The ClusterSingletonManager type exposes the following members.
Name | Description | |
---|---|---|
ClusterSingletonManager |
TBD
|
Name | Description | |
---|---|---|
Listeners |
Retrieves the support needed to interact with an actor's listeners.
(Inherited from FSMTState, TData.) | |
NextStateData |
Return next state data (available in OnTransition(FSMTState, TDataTransitionHandler) handlers)
(Inherited from FSMTState, TData.) | |
Self |
Gets the self ActorRef
(Inherited from ActorBase.) | |
Sender |
Gets the sending ActorRef of the current message
(Inherited from ActorBase.) | |
StateData |
Current state data
(Inherited from FSMTState, TData.) | |
StateName |
Current state name
(Inherited from FSMTState, TData.) |
Name | Description | |
---|---|---|
AroundPostRestart |
Can be overridden to intercept calls to `PostRestart`. Calls `PostRestart` by default.
(Inherited from ActorBase.) | |
AroundPostStop |
Can be overridden to intercept calls to `PostStop`. Calls `PostStop` by default..
(Inherited from ActorBase.) | |
AroundPreRestart |
Can be overridden to intercept calls to `PreRestart`. Calls `PreRestart` by default.
(Inherited from ActorBase.) | |
AroundPreStart |
Can be overridden to intercept calls to `PreStart`. Calls `PreStart` by default.
(Inherited from ActorBase.) | |
AroundReceive |
TBD
(Inherited from ActorBase.) | |
Become |
Changes the actor's command behavior and replaces the current receive handler with the specified handler.
(Inherited from ActorBase.) | |
BecomeStacked |
Changes the actor's behavior and replaces the current receive handler with the specified handler.
The current handler is stored on a stack, and you can revert to it by calling UnbecomeStacked (Inherited from ActorBase.)Remarks Please note, that in order to not leak memory, make sure every call to BecomeStacked(Receive)
is matched with a call to UnbecomeStacked. | |
CancelTimer |
Cancel a named Timer, ensuring that the message is not subsequently delivered (no race.)
(Inherited from FSMTState, TData.) | |
DefaultConfig |
Returns default HOCON configuration for the cluster singleton.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GoTo(TState) |
Produce transition to other state. Return this from a state function
in order to effect the transition.
(Inherited from FSMTState, TData.) | |
GoTo(TState, TData) | Obsolete.
Obsolete. Use GoTo(nextStateName).Using(stateData) instead. (Inherited from FSMTState, TData.) | |
Initialize |
Verify the existence of initial state and setup timers. This should be the
last call within the constructor or PreStart and
PostRestart(Exception).
(Inherited from FSMTState, TData.) | |
IsTimerActive |
Determines whether the named timer is still active. Returns true
unless the timer does not exist, has previously been cancelled, or
if it was a single-shot timer whose message was already received.
(Inherited from FSMTState, TData.) | |
LogTermination |
By default, Failure is logged at error level and other
reason types are not logged. It is possible to override this behavior.
(Inherited from FSMTState, TData.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnTermination |
Set the handler which is called upon termination of this FSM actor. Calling this
method again will overwrite the previous contents.
(Inherited from FSMTState, TData.) | |
OnTransition |
Set handler which is called upon each state transition
(Inherited from FSMTState, TData.) | |
PostRestart |
User overridable callback: By default it calls `PreStart()`.
Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.
(Inherited from ActorBase.) | |
PostStop |
User overridable callback.
Is called asynchronously after 'actor.stop()' is invoked.
Empty default implementation.
(Overrides FSMTState, TDataPostStop.) | |
PreRestart |
User overridable callback: '''By default it disposes of all children and then calls `postStop()`.'''
Is called on a crashed Actor right BEFORE it is restarted to allow clean
up of resources before Actor is terminated.
(Inherited from ActorBase.) | |
PreStart |
User overridable callback.
Is called when an Actor is started.
Actors are automatically started asynchronously when created.
Empty default implementation.
(Overrides ActorBasePreStart.) | |
Props(Props, ClusterSingletonManagerSettings) |
Creates props for the current cluster singleton manager using PoisonPill
as the default termination message.
| |
Props(Props, Object, ClusterSingletonManagerSettings) |
Creates props for the current cluster singleton manager.
| |
Receive |
Processor for user defined messages.
(Inherited from FSMTState, TData.) | |
SetReceiveTimeout | Defines the inactivity timeout after which the sending of a ReceiveTimeout message is triggered. When specified, the receive function should be able to handle a ReceiveTimeout message. Please note that the receive timeout might fire and enqueue the ReceiveTimeout message right after another message was enqueued; hence it is not guaranteed that upon reception of the receive timeout there must have been an idle period beforehand as configured via this method. Once set, the receive timeout stays in effect (i.e. continues firing repeatedly after inactivity periods). Pass in null to switch off this feature. | |
SetStateTimeout |
Set the state timeout explicitly. This method can be safely used from
within a state handler.
(Inherited from FSMTState, TData.) | |
SetTimer |
Schedule named timer to deliver message after given delay, possibly repeating.
Any existing timer with the same name will automatically be canceled before adding
the new timer.
(Inherited from FSMTState, TData.) | |
StartWith |
Sets the initial state for this FSM. Call this method from the constructor before the Initialize method.
If different state is needed after a restart this method, followed by Initialize, can be used in the actor
life cycle hooks PreStart and PostRestart(Exception).
(Inherited from FSMTState, TData.) | |
Stay |
Produce "empty" transition descriptor. Return this from a state function
when no state change is to be effected.
(Inherited from FSMTState, TData.) | |
Stop |
Produce change descriptor to stop this FSM actor with FSMBaseReasonFSMBaseNormal (Inherited from FSMTState, TData.) | |
Stop(FSMBaseReason) |
Produce change descriptor to stop this FSM actor with the specified FSMBaseReason.
(Inherited from FSMTState, TData.) | |
Stop(FSMBaseReason, TData) |
Produce change descriptor to stop this FSM actor with the specified FSMBaseReason.
(Inherited from FSMTState, TData.) | |
SupervisorStrategy |
TBD
(Inherited from ActorBase.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Transform |
TBD
(Inherited from FSMTState, TData.) | |
UnbecomeStacked |
Reverts the Actor behavior to the previous one on the behavior stack.
(Inherited from ActorBase.) | |
Unhandled |
Is called when a message isn't handled by the current behavior of the actor
by default it fails with either a DeathPactException (in
case of an unhandled Terminated message) or publishes an UnhandledMessage
to the actor's system's EventStream (Inherited from ActorBase.) | |
When |
Insert a new FSMTState, TDataStateFunction at the end of the processing chain for the
given state. If the stateTimeout parameter is set, entering this state without a
differing explicit timeout setting will trigger a FSMBaseStateTimeout.
(Inherited from FSMTState, TData.) | |
WhenUnhandled |
Set handler which is called upon reception of unhandled FSM messages. Calling
this method again will overwrite the previous contents.
(Inherited from FSMTState, TData.) |
Name | Description | |
---|---|---|
DebugEvent |
Can be set to enable debugging on certain actions taken by the FSM
(Inherited from FSMTState, TData.) |
Name | Description | |
---|---|---|
AsInstanceOfT |
TBD
(Defined by Extensions.) | |
Match | Overloaded.
Matches the specified target.
(Defined by PatternMatch.) | |
MatchT | Overloaded.
Matches the specified target and return a result of target processing.
(Defined by PatternMatch.) |