Class OutboxWorkerService
- Namespace
- Silverback.Messaging.Producing.TransactionalOutbox
- Assembly
- Silverback.Integration.dll
The IHostedService that triggers the IOutboxWorker at regular intervals.
public class OutboxWorkerService : RecurringDistributedBackgroundService, IHostedService, IDisposable
- Inheritance
-
OutboxWorkerService
- Implements
- Inherited Members
Constructors
OutboxWorkerService(OutboxWorkerSettings, IOutboxWorker, IDistributedLock, ISilverbackLogger<OutboxWorkerService>)
Initializes a new instance of the OutboxWorkerService class.
public OutboxWorkerService(OutboxWorkerSettings settings, IOutboxWorker outboxWorker, IDistributedLock distributedLock, ISilverbackLogger<OutboxWorkerService> logger)
Parameters
settingsOutboxWorkerSettingsThe OutboxWorkerSettings.
outboxWorkerIOutboxWorkerThe IOutboxWorker implementation.
distributedLockIDistributedLockThe IDistributedLock.
loggerISilverbackLogger<OutboxWorkerService>The ISilverbackLogger.
Properties
OutboxWorker
Gets the associated IOutboxWorker.
public IOutboxWorker OutboxWorker { get; }
Property Value
Methods
ExecuteLockedAsync(CancellationToken)
Calls the IOutboxWorker to process the queue.
protected override Task ExecuteLockedAsync(CancellationToken stoppingToken)
Parameters
stoppingTokenCancellationTokenA CancellationToken to observe while waiting for the task to complete.