Normandy.Behaviours.SessionRegistry.Redis (normandy v1.1.1)

View Source

Distributed SessionRegistry using Redis as the shared session_id → pid name table, with cross-node routing over Erlang distribution (Redis replaces Horde's CRDT, not distribution). A per-node owner GenServer holds the Redix connection, monitors locally-registered pids (clearing the key on :DOWN), and refreshes key TTLs so a crashed node's keys lapse on their own.

The handle is the owner's registered name. Registration is atomic via SET … NX (no read-modify-write), so a concurrent start cluster-wide yields one winner; the losers route to it. Use as a :via registry through child_name/2 to get atomic, supervisor-driven starts (closes the start race), exactly like the Horde impl.

Summary

Functions

Returns a specification to start this module under a supervisor.

Test/default handle: start a Redix conn + owner GenServer; return the owner name.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

new(opts \\ [])

@spec new(keyword()) :: atom()

Test/default handle: start a Redix conn + owner GenServer; return the owner name.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()