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
channelChannel<WorkflowWorkItem>workerIWorkflowWorkerdlqIDeadLetterSinkloggerILogger<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
stoppingTokenCancellationTokenTriggered when StopAsync(CancellationToken) is called.
Returns
Remarks
See Worker Services in .NET for implementation guidelines.