Interface IInboxLeaseFeature
Carries an inbox lease across the dispatch boundary in both directions: the term a caller already holds on an entry, and what the inbox deduplication stage subsequently did with the dispatch.
public interface IInboxLeaseFeature
- Extension Methods
Remarks
A caller that has already acquired a lease on an entry and is dispatching it — a drain, typically — sets MessageId, HandlerType and Lease before dispatching. The inbox stage recognises that term as its own caller's and admits the invocation instead of treating the holder as a competitor; without it the stage asks the store for a lease the caller is already holding, is refused, and silently skips the handler.
An invocation admitted on a term it did not mint is a BORROWER. It runs the handler and returns the real result, and it finalizes nothing: the claimant that minted the term owns both the completion and the failure, because that is where attempt accounting lives. A borrower that recorded a failure would clear the term the claimant is about to finalize under, and the attempt would be recorded by nobody.
On return, Disposition reports what the stage did, so the claimant can tell an invocation that ran from one that was refused. The two are otherwise indistinguishable — a refusal and a completion both surface as a successful dispatch.
The term is an admission credential here, not merely an identity, so a store whose lease term is predictable — a timestamp, an expiry, a counter — does not meet the contract this relies on. See the unguessability requirement on the leased-store contract.
This feature is deliberately NOT propagated to child contexts: a term admits an invocation for one specific entry and must not travel to dispatches it was never issued for. Keep it that way.
Properties
Disposition
Gets or sets what the inbox deduplication stage did with this dispatch.
InboxLeaseDisposition Disposition { get; set; }
Property Value
- InboxLeaseDisposition
The disposition; NotEvaluated until the stage runs.
HandlerType
Gets or sets the fully qualified handler type name the term was issued for.
string? HandlerType { get; set; }
Property Value
Lease
Gets or sets the lease term the dispatching caller already holds on the entry.
LeaseToken? Lease { get; set; }
Property Value
- LeaseToken?
The held term, or null when the caller holds no lease.
MessageId
Gets or sets the store identifier of the entry the term was issued for.
string? MessageId { get; set; }