withLeaseOn
withLeaseOn<
A,E,R>(store,options):Effect<Option<A>,E|LeaseFailure,R>
Defined in: packages/core/src/session/lease.ts:63
Holds a session’s writer lease for the duration of use.
The lease renews on a schedule. Each renewal is recorded before the next
wait, so a lost lease is visible to use while it is still running. A store
error does not stop the renewal loop: the lease is only reported lost once a
renewal has failed for longer than its TTL, so one transient failure does not
abort healthy work and a persistent failure cannot hide behind a stale
lost flag. update also checks the owner inside the store, in the same
transaction as the version.
Type Parameters
Section titled “Type Parameters”A
E
R
Parameters
Section titled “Parameters”options
Section titled “options”LeaseOptions<A, E, R>
Returns
Section titled “Returns”Effect<Option<A>, E | LeaseFailure, R>