Table of Contents

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

settings OutboxWorkerSettings

The OutboxWorkerSettings.

outboxWorker IOutboxWorker

The IOutboxWorker implementation.

distributedLock IDistributedLock

The IDistributedLock.

logger ISilverbackLogger<OutboxWorkerService>

The ISilverbackLogger.

Properties

OutboxWorker

Gets the associated IOutboxWorker.

public IOutboxWorker OutboxWorker { get; }

Property Value

IOutboxWorker

Methods

ExecuteLockedAsync(CancellationToken)

Calls the IOutboxWorker to process the queue.

protected override Task ExecuteLockedAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

Task

A Task representing the asynchronous operation.