Durable ownership token for one active session continuation.
A store grants one lease at a time. Every durable checkpoint and final commit must present the same lease id. An expired lease can be replaced by recovery.
Summary
Functions
Builds a new lease for one request.
Returns true when the lease has reached its expiry time.
Builds a session lease from keyword or map attributes.
Extends a lease from the given wall-clock time.
Returns the Zoi schema for a session lease.
Types
Functions
@spec acquire(String.t(), non_neg_integer(), pos_integer(), keyword()) :: {:ok, t()} | {:error, term()}
Builds a new lease for one request.
@spec expired?(t(), non_neg_integer()) :: boolean()
Returns true when the lease has reached its expiry time.
Builds a session lease from keyword or map attributes.
@spec renew(t(), non_neg_integer(), pos_integer()) :: t()
Extends a lease from the given wall-clock time.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for a session lease.