Craig's Utility Library
4.0 Beta
|
Class that helps with running tasks in parallel on a set of objects (that will come in on an ongoing basis, think producer/consumer situations) More...
Public Member Functions | |
TaskQueue (int Capacity, Action< T > ProcessItem, Action< Exception > HandleError=null) | |
Constructor More... | |
void | Cancel (bool Wait=false) |
Cancels the queue from processing More... | |
void | Enqueue (T Item) |
Adds the item to the queue to be processed More... | |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Disposes of the objects More... | |
Properties | |
bool | IsCanceled [get] |
Determines if it has been cancelled More... | |
bool | IsComplete [get] |
Determines if it has completed all tasks More... | |
Class that helps with running tasks in parallel on a set of objects (that will come in on an ongoing basis, think producer/consumer situations)
T | Object type to process |
Definition at line 36 of file TaskQueue.cs.
Utilities.DataTypes.TaskQueue< T >.TaskQueue | ( | int | Capacity, |
Action< T > | ProcessItem, | ||
Action< Exception > | HandleError = null |
||
) |
Constructor
Capacity | Number of items that are allowed to be processed in the queue at one time |
ProcessItem | Action that is used to process each item |
HandleError | Handles an exception if it occurs (defaults to eating the error) |
Definition at line 48 of file TaskQueue.cs.
void Utilities.DataTypes.TaskQueue< T >.Cancel | ( | bool | Wait = false | ) |
Cancels the queue from processing
Wait | Determines if the function should wait for the tasks to complete before returning |
Definition at line 101 of file TaskQueue.cs.
|
protected |
Disposes of the objects
disposing | True to dispose of all resources, false only disposes of native resources |
Definition at line 126 of file TaskQueue.cs.
void Utilities.DataTypes.TaskQueue< T >.Enqueue | ( | T | Item | ) |
Adds the item to the queue to be processed
Item | Item to process |
Definition at line 114 of file TaskQueue.cs.
|
get |
Determines if it has been cancelled
Definition at line 63 of file TaskQueue.cs.
|
get |
Determines if it has completed all tasks
Definition at line 71 of file TaskQueue.cs.