Normandy.Behaviours.SessionStore.Redis
(normandy v1.1.0)
View Source
Durable SessionStore over Redis, modelled on Redis Streams. The conversation is an
append-only stream (XADD/XRANGE) so appends are atomic and O(1) with no
read-modify-write — concurrent appends never lose an entry. Session metadata
(turn state, config template, resume policy) lives in a hash; eager session_ids live
in a SET for list_resumable/1.
The handle is {conn, namespace} (the host owns the Redix connection, Oban-style).
All of a session's keys share a {sid} hash-tag so multi-key reads/forks stay in one
Redis Cluster slot. Opaque values use term_to_binary / binary_to_term(_, [:safe]).
Durability is the operator's Redis config (AOF recommended). For the fail-closed
invariant, pass wait: {numreplicas, timeout_ms} so boundary writes block on
replica acknowledgement and fail the turn if unmet.
Summary
Functions
Test/default handle: a Redix conn to the configured URL + a unique namespace.