Table of Contents

Class InMemoryWorkflowWorkerService

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

In-process worker that reads from the shared channel and delegates to a registered IWorkflowWorker implementation.

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

Constructors

InMemoryWorkflowWorkerService(Channel<WorkflowWorkItem>, IWorkflowWorker, IDeadLetterSink, ILogger<InMemoryWorkflowWorkerService>)

Initializes the background service.

public InMemoryWorkflowWorkerService(Channel<WorkflowWorkItem> channel, IWorkflowWorker worker, IDeadLetterSink dlq, ILogger<InMemoryWorkflowWorkerService> logger)

Parameters

channel Channel<WorkflowWorkItem>
worker IWorkflowWorker
dlq IDeadLetterSink
logger ILogger<InMemoryWorkflowWorkerService>

Methods

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.