Table of Contents

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

channel Channel<WorkflowWorkItem>

Methods

DispatchAsync(WorkflowWorkItem, CancellationToken)

Dispatches a workflow work item for execution.

public Task DispatchAsync(WorkflowWorkItem item, CancellationToken ct = default)

Parameters

item WorkflowWorkItem

The work item to dispatch.

ct CancellationToken

Cancellation token.

Returns

Task

DisposeAsync()

Completes the channel, signalling no further items will be written.

public ValueTask DisposeAsync()

Returns

ValueTask