Partition process for session route state.
Each partition owns an ETS table with TTL and capacity pruning so session lookups can resolve exact routes, room-scoped fallbacks, or supplied fallback routes without centralizing all traffic in one process.
Summary
Functions
Returns a specification to start this module under a supervisor.
Fetches a stored route record for a session key.
Removes expired entries from a partition immediately.
Resolves a session route from exact, room-scoped, or provided fallback routes.
Stores a route for a session key in the selected partition.
Starts a session manager partition process.
Returns the registered process for a partition, if it is running.
Types
@type state() :: %{ instance_module: module(), partition: non_neg_integer(), table: :ets.tid(), ttl_ms: pos_integer(), max_entries_per_partition: pos_integer(), prune_interval_ms: pos_integer(), order: :queue.queue(), next_seq: non_neg_integer() }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get( module(), non_neg_integer(), Jido.Messaging.SessionManager.session_key(), timeout() ) :: {:ok, Jido.Messaging.SessionManager.route_record()} | {:error, :not_found | :expired | :partition_unavailable}
Fetches a stored route record for a session key.
@spec prune(module(), non_neg_integer(), timeout()) :: {:ok, %{pruned: non_neg_integer()}} | {:error, :partition_unavailable}
Removes expired entries from a partition immediately.
@spec resolve( module(), non_neg_integer(), Jido.Messaging.SessionManager.session_key(), [Jido.Messaging.SessionManager.route()], timeout() ) :: {:ok, Jido.Messaging.SessionManager.resolution()} | {:error, :no_route | :partition_unavailable}
Resolves a session route from exact, room-scoped, or provided fallback routes.
@spec set( module(), non_neg_integer(), Jido.Messaging.SessionManager.session_key(), Jido.Messaging.SessionManager.route(), keyword(), timeout() ) :: :ok | {:error, :partition_unavailable}
Stores a route for a session key in the selected partition.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a session manager partition process.
@spec whereis(module(), non_neg_integer()) :: pid() | nil
Returns the registered process for a partition, if it is running.