Class OutboxWorkerService
The IHostedService that triggers the IOutboxWorker at regular intervals.
Inheritance
OutboxWorkerService
Inherited Members
Namespace: Silverback.Messaging.Producing.TransactionalOutbox
Assembly: Silverback.Integration.dll
Syntax
public class OutboxWorkerService : RecurringDistributedBackgroundService, IHostedService, IDisposable
Constructors
OutboxWorkerService(OutboxWorkerSettings, IOutboxWorker, IDistributedLock, ISilverbackLogger<OutboxWorkerService>)
Initializes a new instance of the OutboxWorkerService class.
Declaration
public OutboxWorkerService(OutboxWorkerSettings settings, IOutboxWorker outboxWorker, IDistributedLock distributedLock, ISilverbackLogger<OutboxWorkerService> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| OutboxWorkerSettings | settings | The OutboxWorkerSettings. |
| IOutboxWorker | outboxWorker | The IOutboxWorker implementation. |
| IDistributedLock | distributedLock | The IDistributedLock. |
| ISilverbackLogger<OutboxWorkerService> | logger | The ISilverbackLogger. |
Properties
OutboxWorker
Gets the associated IOutboxWorker.
Declaration
public IOutboxWorker OutboxWorker { get; }
Property Value
| Type | Description |
|---|---|
| IOutboxWorker |
Methods
ExecuteLockedAsync(CancellationToken)
Calls the IOutboxWorker to process the queue.
Declaration
protected override Task ExecuteLockedAsync(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 representing the asynchronous operation. |