Skip to content

withLeaseWithin

withLeaseWithin<A, E, R>(store, options): Effect<Option<A>, LeaseFailure | E, R>

Defined in: packages/core/src/session/lease.ts:134

Acquires a lease within a bounded window instead of dropping the first miss.

A chat interaction can arrive while another process is committing the same session. The old behaviour returned Option.none immediately, so the press was lost even though the lease would have been free a few milliseconds later. This keeps the interaction in the interactionMachine waiting state until the deadline, then gives up explicitly.

A

E

R

StrongMessageSessionStore

WindowLeaseOptions<A, E, R>

Effect<Option<A>, LeaseFailure | E, R>