Zum Hauptinhalt springen

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​

Boolean

HasLease​

public bool HasLease { get; }

Property Value​

Boolean

LeaseTenantId​

public string LeaseTenantId { get; }

Property Value​

String

HasTenant​

public bool HasTenant { get; }

Property Value​

Boolean

TenantId​

public string TenantId { get; }

Property Value​

String

Constructors​

AdapterPoolTenantScope()​

public AdapterPoolTenantScope()

Methods​

BeginLease(String)​

public IDisposable BeginLease(string tenantId)

Parameters​

tenantId String

Returns​

IDisposable

BeginExecution(String)​

public IDisposable BeginExecution(string tenantId)

Parameters​

tenantId String

Returns​

IDisposable