class Session::ClusterCoordinator(T)

Overview

Main cluster coordinator for managing pub/sub and local caching

Generic Constraint: T must inherit from Session::Base - represents the session type Internally manages LocalCache(T) for caching complete session objects

Defined in:

cluster.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(redis : Redis, config : ClusterConfig = ClusterConfig.new) #

[View source]

Instance Method Detail

def config : ClusterConfig #

[View source]
def local_cache : LocalCache(T) #

[View source]
def node_id : String #

[View source]
def publish_cache_clear : Nil #

Publish a cache clear message to all nodes


[View source]
def publish_invalidation(session_id : String) : Nil #

Publish a session invalidation message to the cluster


[View source]
def publish_session_invalidated(session_id : String) : Nil #

Publish a session updated message (for invalidation on update)


[View source]
def running? : Bool #

Check if the coordinator is running


[View source]
def start : Nil #

Start the background subscription fiber


[View source]
def stop : Nil #

Gracefully stop the coordinator


[View source]