PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.IParallelWorker Interface Reference

Describes a parallel worker for actions. More...

Inheritance diagram for PeanutButter.Utils.IParallelWorker:
PeanutButter.Utils.IWorker PeanutButter.Utils.ParallelWorker

Public Member Functions

void AddWorkers (IEnumerable< Action > workers)
 Add some workers to the queue. If the work is already running, they will be added to the end and executed when the queue is complete.
void AddWorker (Action worker)
 Add a single worker to the queue. If the work is already running, it will be added to the end and executed when the queue is complete.
Exception[] RunAll ()
 Run all the queued work with the default max degree of parallelism.
Exception[] RunAll (int maxDegreeOfParallelism)
 Run all the queued work with the provided max degree of parallelism.

Additional Inherited Members

Properties inherited from PeanutButter.Utils.IWorker
bool Busy [get]
 Will be true whilst the worker is busy.
int DefaultMaxDegreeOfParallelism [get, set]
 Indicates the default MaxDegreeOfParallelism for ParallelWorker (should default to the number of available cores, on the assumption that workloads are more often cpu-bound than I/O-bound).

Detailed Description

Describes a parallel worker for actions.

Member Function Documentation

◆ AddWorker()

void PeanutButter.Utils.IParallelWorker.AddWorker ( Action worker)

Add a single worker to the queue. If the work is already running, it will be added to the end and executed when the queue is complete.

Parameters
worker

Implemented in PeanutButter.Utils.ParallelWorker.

◆ AddWorkers()

void PeanutButter.Utils.IParallelWorker.AddWorkers ( IEnumerable< Action > workers)

Add some workers to the queue. If the work is already running, they will be added to the end and executed when the queue is complete.

Parameters
workers

Implemented in PeanutButter.Utils.ParallelWorker.

◆ RunAll() [1/2]

Exception[] PeanutButter.Utils.IParallelWorker.RunAll ( )

Run all the queued work with the default max degree of parallelism.

Returns

Implemented in PeanutButter.Utils.ParallelWorker.

◆ RunAll() [2/2]

Exception[] PeanutButter.Utils.IParallelWorker.RunAll ( int maxDegreeOfParallelism)

Run all the queued work with the provided max degree of parallelism.

Returns

Implemented in PeanutButter.Utils.ParallelWorker.


The documentation for this interface was generated from the following file:
  • source/Utils/PeanutButter.Utils/ParallelWorker.cs