Pure durable session state transitions.
This module validates revisions, leases, claims, checkpoints, commits, and recovery. It does not call a store or another external service.
Summary
Functions
Records a durable snapshot under an active lease.
Claims a session with a worker lease for one request.
Claims a caller-managed session without a store lease.
Commits session state and releases its active lease.
Validates a direct session write against the current session.
Replaces an expired lease for crash recovery.
Returns true when a running session has recoverable expired work.
Extends an active session lease.
Claims a hibernated or waiting session for resume.
Functions
@spec checkpoint(Jidoka.Session.Data.t(), String.t(), Jidoka.Snapshot.t(), keyword()) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Records a durable snapshot under an active lease.
@spec claim(Jidoka.Session.Data.t(), Jidoka.Turn.Request.t(), keyword()) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Claims a session with a worker lease for one request.
@spec claim_without_lease(Jidoka.Session.Data.t(), Jidoka.Turn.Request.t()) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Claims a caller-managed session without a store lease.
@spec commit(Jidoka.Session.Data.t(), String.t(), Jidoka.Session.Data.t(), keyword()) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Commits session state and releases its active lease.
@spec put(Jidoka.Session.Data.t() | nil, Jidoka.Session.Data.t()) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Validates a direct session write against the current session.
@spec recover( Jidoka.Session.Data.t(), keyword() ) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Replaces an expired lease for crash recovery.
@spec recoverable?(Jidoka.Session.Data.t(), non_neg_integer()) :: boolean()
Returns true when a running session has recoverable expired work.
@spec renew(Jidoka.Session.Data.t(), String.t(), keyword()) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Extends an active session lease.
@spec resume( Jidoka.Session.Data.t(), keyword() ) :: {:ok, Jidoka.Session.Data.t()} | {:error, term()}
Claims a hibernated or waiting session for resume.