Class InMemoryWorkflowDispatcher
- Namespace
- JD.AI.Workflows.Distributed.InMemory
- Assembly
- JD.AI.Workflows.Distributed.dll
In-process dispatcher and worker backed by a bounded Channel<T>. Suitable for local development, testing, and single-process deployments.
public sealed class InMemoryWorkflowDispatcher : IWorkflowDispatcher, IAsyncDisposable
- Inheritance
-
InMemoryWorkflowDispatcher
- Implements
- Inherited Members
Constructors
InMemoryWorkflowDispatcher(Channel<WorkflowWorkItem>)
Initializes the dispatcher with the given channel.
public InMemoryWorkflowDispatcher(Channel<WorkflowWorkItem> channel)
Parameters
channelChannel<WorkflowWorkItem>
Methods
DispatchAsync(WorkflowWorkItem, CancellationToken)
Dispatches a workflow work item for execution.
public Task DispatchAsync(WorkflowWorkItem item, CancellationToken ct = default)
Parameters
itemWorkflowWorkItemThe work item to dispatch.
ctCancellationTokenCancellation token.
Returns
DisposeAsync()
Completes the channel, signalling no further items will be written.
public ValueTask DisposeAsync()