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