Table of Contents

Class GovernanceOutboxDrain

Namespace
AsiBackbone.Core.Outbox
Assembly
AsiBackbone.Core.dll

Drains provider-neutral outbox entries through a configured governance emitter.

public sealed class GovernanceOutboxDrain
Inheritance
GovernanceOutboxDrain
Inherited Members

Remarks

This drain path is provider-neutral. It is suitable for tests, samples, local validation, and host-owned workers that need to hand persisted outbox entries to an optional downstream emitter without coupling Core to a provider SDK.

Constructors

GovernanceOutboxDrain(IGovernanceOutboxStore, IGovernanceEmitter, ILogger<GovernanceOutboxDrain>?, IOptions<GovernanceOutboxOptions>?, TimeProvider?)

Drains provider-neutral outbox entries through a configured governance emitter.

public GovernanceOutboxDrain(IGovernanceOutboxStore outboxStore, IGovernanceEmitter emitter, ILogger<GovernanceOutboxDrain>? logger = null, IOptions<GovernanceOutboxOptions>? outboxOptions = null, TimeProvider? timeProvider = null)

Parameters

outboxStore IGovernanceOutboxStore

The provider-neutral outbox store.

emitter IGovernanceEmitter

The provider-neutral governance emitter.

logger ILogger<GovernanceOutboxDrain>

The logger used to record local operational diagnostics for drain failures.

outboxOptions IOptions<GovernanceOutboxOptions>

The provider-neutral retry, poison-message, and claim options used by the drain.

timeProvider TimeProvider

The clock used for the drain time and per-page claim-lease time when DrainAsync(DateTimeOffset?, int, CancellationToken) is called without an explicit timestamp. Defaults to System; dependency injection supplies a registered TimeProvider.

Remarks

This drain path is provider-neutral. It is suitable for tests, samples, local validation, and host-owned workers that need to hand persisted outbox entries to an optional downstream emitter without coupling Core to a provider SDK.

Methods

DrainAsync(DateTimeOffset?, int, CancellationToken)

Drains pending and retry-ready outbox entries through the configured emitter.

public ValueTask<IReadOnlyList<GovernanceOutboxEntry>> DrainAsync(DateTimeOffset? utcNow = null, int maxCount = 100, CancellationToken cancellationToken = default)

Parameters

utcNow DateTimeOffset?

The UTC timestamp used for retry-ready checks. When omitted, the configured TimeProvider is read.

maxCount int

The maximum number of entries to drain.

cancellationToken CancellationToken

A cancellation token.

Returns

ValueTask<IReadOnlyList<GovernanceOutboxEntry>>

The updated outbox entries that were attempted by the drain.