Class OutboxWorkerService
The IHostedService that triggers the outbound queue worker at regular intervals.
Inheritance
OutboxWorkerService
Inherited Members
Namespace: Silverback.Messaging.Outbound.TransactionalOutbox
Assembly: Silverback.Integration.dll
Syntax
public class OutboxWorkerService : RecurringDistributedBackgroundService, IHostedService, IDisposable
Constructors
| Improve this doc View sourceOutboxWorkerService(TimeSpan, IOutboxWorker, DistributedLockSettings, IDistributedLockManager, ISilverbackLogger<OutboxWorkerService>)
Initializes a new instance of the OutboxWorkerService class.
Declaration
public OutboxWorkerService(TimeSpan interval, IOutboxWorker outboxWorker, DistributedLockSettings distributedLockSettings, IDistributedLockManager distributedLockManager, ISilverbackLogger<OutboxWorkerService> logger)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | interval | The interval between each execution. |
IOutboxWorker | outboxWorker | The IOutboxWorker implementation. |
DistributedLockSettings | distributedLockSettings | Customizes the lock mechanism settings. |
IDistributedLockManager | distributedLockManager | |
ISilverbackLogger<OutboxWorkerService> | logger | The ISilverbackLogger. |
Methods
| Improve this doc View sourceExecuteRecurringAsync(CancellationToken)
Calls the IOutboxWorker to process the queue at regular intervals.
Declaration
protected override Task ExecuteRecurringAsync(CancellationToken stoppingToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | stoppingToken | A CancellationToken to observe while waiting for the task to complete. |
Returns
Type | Description |
---|---|
Task | A Task that represents the long running operations. |