Class GovernanceOutboxDrain
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
outboxStoreIGovernanceOutboxStoreThe provider-neutral outbox store.
emitterIGovernanceEmitterThe provider-neutral governance emitter.
loggerILogger<GovernanceOutboxDrain>The logger used to record local operational diagnostics for drain failures.
outboxOptionsIOptions<GovernanceOutboxOptions>The provider-neutral retry, poison-message, and claim options used by the drain.
timeProviderTimeProviderThe 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
utcNowDateTimeOffset?The UTC timestamp used for retry-ready checks. When omitted, the configured TimeProvider is read.
maxCountintThe maximum number of entries to drain.
cancellationTokenCancellationTokenA cancellation token.
Returns
- ValueTask<IReadOnlyList<GovernanceOutboxEntry>>
The updated outbox entries that were attempted by the drain.