Class OutboxWorkerService
The Microsoft.Extensions.Hosting.IHostedService that triggers the outbound queue worker at regular intervals.
Inheritance
System.Object
Microsoft.Extensions.Hosting.BackgroundService
OutboxWorkerService
Implements
Microsoft.Extensions.Hosting.IHostedService
System.IDisposable
Inherited Members
Microsoft.Extensions.Hosting.BackgroundService.StartAsync(System.Threading.CancellationToken)
Microsoft.Extensions.Hosting.BackgroundService.StopAsync(System.Threading.CancellationToken)
Microsoft.Extensions.Hosting.BackgroundService.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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 |
---|---|---|
System.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 |
---|---|---|
System.Threading.CancellationToken | stoppingToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
Implements
Microsoft.Extensions.Hosting.IHostedService
System.IDisposable