AdapterPoolTenantScope
Namespace: Meshmakers.Octo.Sdk.Common.Services
The pool-member implementation of IAdapterTenantScope (AB#4924, increment 6).
public sealed class AdapterPoolTenantScope : IAdapterLeaseScope, IAdapterTenantScope
Inheritance Object → AdapterPoolTenantScope
Implements IAdapterLeaseScope, IAdapterTenantScope
Remarks:
Replaces AdapterTenantScope in a process that is a pool member. The difference is the lease: a dedicated adapter only ever has the per-execution tenant, a pool member has a lease tenant that the executions of that lease run inside.
🔴 The guard in is the part worth reading. While a lease is held, entering an execution for a different tenant throws. Nothing in the SDK is supposed to do that — but "nothing is supposed to" is exactly the assumption that produces a cross-tenant read when some future trigger fires late, or a queued work item is picked up a moment after the lease it belonged to was released. The check turns that into a loud failure on the member instead of a plausible-looking wrong answer in a borrower's data.
Properties
IsPoolMember
public bool IsPoolMember { get; }
Property Value
HasLease
public bool HasLease { get; }
Property Value
LeaseTenantId
public string LeaseTenantId { get; }
Property Value
HasTenant
public bool HasTenant { get; }
Property Value
TenantId
public string TenantId { get; }
Property Value
Constructors
AdapterPoolTenantScope()
public AdapterPoolTenantScope()
Methods
BeginLease(String)
public IDisposable BeginLease(string tenantId)
Parameters
tenantId String
Returns
BeginExecution(String)
public IDisposable BeginExecution(string tenantId)
Parameters
tenantId String