class Movie::ClusterReceptionistExtension

Defined in:

movie/cluster/receptionist/extension.cr
movie/cluster/receptionist/replication.cr

Constant Summary

DAEMON_NAME = "receptionist"
EVENT_LISTENER_NAME = "receptionist-events"
Log = ::Log.for(self)
PROTOCOL_TAG = "movie.cluster.receptionist.envelope.v1"
SYNC_INTERVAL = 250.milliseconds
WATCHER_NAME = "receptionist-watcher"

Constructors

Instance Method Summary

Instance methods inherited from class Movie::Extension

start start, stop stop

Constructor Detail

def self.new(system : AbstractActorSystem) #

[View source]

Instance Method Detail

def deregister(key : Cluster::ServiceKey(T), actor : ActorRef(T)) : Bool forall T #

Removes one local actor registration. Repeated removal is idempotent.


[View source]
def find(key : Cluster::ServiceKey(T)) : Cluster::ReceptionistListing(T) forall T #

Returns a defensive, deterministically ordered snapshot of reachable services currently visible from this node.


[View source]
def handle_cluster_event(event : Cluster::ClusterEvent) : Nil #

[View source]
def handle_envelope(envelope : Cluster::ReceptionistEnvelope, sender_path : ActorPath | Nil, remote_address : Address | Nil, remote_node_uid : String | Nil) : Nil #

[View source]
def local_actor_terminated(actor : ActorRefBase) : Nil #

Internal watcher entrypoint.


[View source]
def register(key : Cluster::ServiceKey(T), actor : ActorRef(T)) : Bool forall T #

Registers a local actor under a typed cluster-wide service key.


[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]

[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(key : Cluster::ServiceKey(T), subscriber : ActorRef(Cluster::ReceptionistListing(T))) : Bool forall T #

Subscribes a local typed actor and immediately publishes the current listing. Returns false when the exact subscription already exists.


[View source]
def unsubscribe(key : Cluster::ServiceKey(T), subscriber : ActorRef(Cluster::ReceptionistListing(T))) : Bool forall T #

Removes an exact local typed subscription.


[View source]