<PackageReference Include="NUnit" Version="3.9.0" />

ParallelWorkItemDispatcher

ParallelWorkItemDispatcher handles execution of work items by queuing them for worker threads to process.
public int LevelOfParallelism { get; }

Number of parallel worker threads

public IEnumerable<WorkItemQueue> Queues { get; }

Enumerates all the Queues supported by the dispatcher

public IEnumerable<WorkShift> Shifts { get; }

Enumerates all the shifts supported by the dispatcher

Event raised whenever a shift has ended.

Event raised whenever a shift is starting.

public ParallelWorkItemDispatcher(int levelOfParallelism)

Construct a ParallelWorkItemDispatcher

public void CancelRun(bool force)

Cancel the ongoing run completely. If no run is in process, the call has no effect.

public void Dispatch(WorkItem work)

Dispatch a single work item for execution. The first work item dispatched is saved as the top-level work item and used when stopping the run.

public void Start(WorkItem topLevelWorkItem)

Start execution, setting the top level work, enqueuing it and starting a shift to execute it.