class Movie::Cluster::ClusterExtension

Defined in:

movie/cluster/extension.cr

Constant Summary

DAEMON_NAME = CLUSTER_DAEMON_NAME
Log = ::Log.for(self)
PROTOCOL_TAG = "movie.cluster.protocol.v1"

Constructors

Instance Method Summary

Instance methods inherited from class Movie::Extension

start start, stop stop

Constructor Detail

def self.new(system : Movie::AbstractActorSystem, settings : ClusterSettings = ClusterSettings.new) #

[View source]

Instance Method Detail

def await_removed(timeout_span : Time::Span = 10.seconds) : Nil #

[View source]
def await_up(timeout_span : Time::Span = 10.seconds) : Nil #

[View source]
def converged? : Bool #

[View source]
def down(target : UniqueAddress) : Bool #

Manual downing never runs from reachability alone. The operator chooses the exact process incarnation after resolving any partition ambiguity.


[View source]
def handle_protocol(message : ProtocolMessage, sender_path : Movie::ActorPath | Nil, remote_address : Movie::Address | Nil, remote_node_uid : String | Nil) : Nil #

Internal actor entrypoint. Remote protocol traffic must carry both the actor address and process incarnation authenticated by remoting.


[View source]
def join(seed : Movie::Address) : Nil #

Adds a seed dynamically and sends an idempotent join immediately.


[View source]
def leave : Bool #

Graceful leave is coordinated by the current reachable leader and is terminal for this process incarnation.


[View source]
def register_departure_guard(name : String, &guard : UniqueAddress -> Bool) : Nil #

Registers an advanced extension-level barrier for graceful departure. The callback must be non-blocking and return true only when member may advance from Leaving to Exiting. Exceptions fail closed for that round.


[View source]
def self_member : Member #

[View source]
def self_unique_address : UniqueAddress #

[View source]
def settings : ClusterSettings #

[View source]
def snapshot : ClusterSnapshot #

[View source]
def start : Bool #
Description copied from class Movie::Extension

Called when the extension is registered with the system. Override to perform initialization.


[View source]
def stats : ClusterStats #

[View source]
def stop : Nil #
Description copied from class Movie::Extension

Called when the system is shutting down. Override to cleanup resources (close connections, stop services, etc.)


[View source]
def subscribe(subscriber : Movie::ActorRef(ClusterEvent), replay_state : Bool = true) : Nil #

[View source]
def unregister_departure_guard(name : String) : Nil #

Removes a previously registered graceful-departure barrier.


[View source]
def unsubscribe(subscriber : Movie::ActorRef(ClusterEvent)) : Nil #

[View source]
def up? : Bool #

[View source]