Table of Contents

Class ServiceBusWorkflowWorkerService

Namespace
JD.AI.Workflows.Distributed.AzureServiceBus
Assembly
JD.AI.Workflows.Distributed.dll

Azure Service Bus processor worker that delegates to IWorkflowWorker.

public sealed class ServiceBusWorkflowWorkerService : BackgroundService, IHostedService, IDisposable
Inheritance
ServiceBusWorkflowWorkerService
Implements
Inherited Members

Constructors

ServiceBusWorkflowWorkerService(ServiceBusClient, IWorkflowWorker, IDeadLetterSink, ServiceBusWorkflowOptions, ILogger<ServiceBusWorkflowWorkerService>)

Initializes the worker service.

public ServiceBusWorkflowWorkerService(ServiceBusClient client, IWorkflowWorker worker, IDeadLetterSink dlq, ServiceBusWorkflowOptions options, ILogger<ServiceBusWorkflowWorkerService> logger)

Parameters

client ServiceBusClient
worker IWorkflowWorker
dlq IDeadLetterSink
options ServiceBusWorkflowOptions
logger ILogger<ServiceBusWorkflowWorkerService>

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public override void Dispose()

ExecuteAsync(CancellationToken)

This method is called when the IHostedService starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.

protected override Task ExecuteAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

Triggered when StopAsync(CancellationToken) is called.

Returns

Task

A Task that represents the long running operations.

Remarks

See Worker Services in .NET for implementation guidelines.