ProcessQueueT Class

Represents a thread-safe (via locking) list of items, based on ListT, that get processed on independent threads with a consumer provided function.

Definition

Namespace: Gemstone.Threading.Collections
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.128 -- Release Build+d4a9a653be1def5888b9be91bb1825c8655f3529
Inheritance
Object    ProcessQueueT
Implements
IProvideStatus, ISupportLifecycle, ICollectionT, IEnumerableT, IListT, IEnumerable, IDisposable

Type Parameters

T
Type of object to process

Remarks

This class acts as a strongly-typed collection of objects to be processed.

Note that the ProcessQueueT will not start processing until the Start method is called.

Constructors

Properties

CancellationToken Gets the per processing thread cancellation token to check when a ProcessTimeout is specified.
CanProcessItemFunction Gets or sets the user function determining if an item is ready to be processed.
CountGets the number of elements actually contained in the ProcessQueueT.
CurrentStatistics Gets the current run-time statistics of the ProcessQueueT as a single group of values.
Enabled Gets or sets indicator that the ProcessQueueT is currently enabled.
InternalEnumerable Allows derived classes to access the interfaced internal ProcessQueueT directly.
InternalList Gets the internal list for direct use by ProcessQueueT.
IsDisposed Gets a flag that indicates whether the object has been disposed.
IsEmpty Gets a value that indicates whether the ProcessQueueT is empty.
IsProcessing Gets indicator that the ProcessQueueT is actively processing items.
IsReadOnlyGets a value indicating whether the ProcessQueueT is read-only.
IsSynchronizedGets a value indicating whether access to the ProcessQueueT is synchronized (thread safe). Always returns true for ProcessQueueT.
Item Gets or sets the element at the specified index.
ItemsBeingProcessed Gets the total number of items currently being processed.
MaximumThreads Gets or sets the maximum number of threads to process simultaneously.
Name Gets or sets name for this ProcessQueueT.
ProcessingIsRealTime Gets indicator that items will be processed in real-time.
ProcessingStyle Gets the item QueueProcessingStyle for the ProcessQueueT (i.e., one at a time or many at once).
ProcessInterval Gets or sets the interval, in milliseconds, on which new items begin processing.
ProcessItemFunction Gets or sets the user function for processing individual items in the ProcessQueueT one at a time.
ProcessItemsFunction Gets or sets the user function for processing multiple items in the ProcessQueueT at once.
ProcessTimeout Gets or sets the maximum time, in milliseconds, allowed for processing an item.
RequeueModeOnException Gets or sets the mode of insertion used (prefix or suffix) when at item is placed back into the ProcessQueueT after an exception occurs while processing.
RequeueModeOnTimeout Gets or sets the mode of insertion used (prefix or suffix) when at item is placed back into the ProcessQueueT after processing times out.
RequeueOnException Gets or sets whether or not to automatically place an item back into the ProcessQueueT if an exception occurs while processing.
RequeueOnTimeout Gets or sets whether or not to automatically place an item back into the ProcessQueueT if the processing times out.
RunTime Gets the total amount of time, in seconds, that the ProcessQueueT has been active.
Status Gets current status of ProcessQueueT.
SynchronizedOperationType Gets or sets the type of synchronized operation used to process items in a real-time ProcessQueueT.
SyncRoot Gets an object that can be used to synchronize access to the ProcessQueueT.
ThreadCount Gets the current number of active threads.
ThreadingMode Gets the current QueueThreadingMode for the ProcessQueueT (i.e., synchronous or asynchronous).
TotalFunctionCalls Gets the total number of calls to ProcessItemFunction or ProcessItemsFunction.
TotalProcessedItems Gets the total number of items processed so far.

Methods

AddAdds an item to the ProcessQueueT.
AddRange Adds the elements of the specified collection to the end of the ProcessQueueT.
BinarySearch(T) Searches the entire sorted ProcessQueueT, using a binary search algorithm, for an element using the default comparer and returns the zero-based index of the element.
BinarySearch(T, IComparerT) Searches the entire sorted ProcessQueueT, using a binary search algorithm, for an element using the specified comparer and returns the zero-based index of the element.
BinarySearch(Int32, Int32, T, IComparerT) Searches a range of elements in the sorted ProcessQueueT, using a binary search algorithm, for an element using the specified comparer and returns the zero-based index of the element.
CanProcessItem Determines if an item can be processed.
CanProcessItems Determines if all items can be processed.
Clear Removes all elements from the ProcessQueueT.
Contains Determines whether an element is in the ProcessQueueT.
ConvertAllTOutputConverts the elements in the current ProcessQueueT to another type, and returns a ProcessQueueT containing the converted elements.
CopyToCopies the entire ProcessQueueT to a compatible one-dimensional array, starting at the beginning of the target array.
CreateAsynchronousQueue(ProcessQueueTProcessItemFunctionSignature) Creates a new asynchronous ProcessQueueT with the default settings: ProcessInterval = 100, MaximumThreads = 5, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemsFunctionSignature) Creates a new asynchronous, bulk item ProcessQueueT with the default settings: ProcessInterval = 100, MaximumThreads = 5, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature) Creates a new asynchronous ProcessQueueT with the default settings: ProcessInterval = 100, MaximumThreads = 5, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemFunctionSignature, Int32) Creates a new asynchronous ProcessQueueT with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature) Creates a new asynchronous, bulk item ProcessQueueT with the default settings: ProcessInterval = 100, MaximumThreads = 5, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, Int32) Creates a new asynchronous, bulk item ProcessQueueT with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Int32) Creates a new asynchronous ProcessQueueT with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Int32) Creates a new asynchronous, bulk item ProcessQueueT with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateAsynchronousQueue(ProcessQueueTProcessItemFunctionSignature, Double, Int32, Int32, Boolean, Boolean) Creates a new asynchronous ProcessQueueT using specified settings.
CreateAsynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, Double, Int32, Int32, Boolean, Boolean) Creates a new asynchronous, bulk item ProcessQueueT using specified settings.
CreateAsynchronousQueue(ProcessQueueTProcessItemFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Double, Int32, Int32, Boolean, Boolean) Creates a new asynchronous ProcessQueueT using specified settings.
CreateAsynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Double, Int32, Int32, Boolean, Boolean) Creates a new asynchronous, bulk item ProcessQueueT using specified settings.
CreateRealTimeQueue(ProcessQueueTProcessItemFunctionSignature) Creates a new real-time ProcessQueueT with the default settings: ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateRealTimeQueue(ProcessQueueTProcessItemsFunctionSignature) Creates a new real-time, bulk item ProcessQueueT with the default settings: ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateRealTimeQueue(ProcessQueueTProcessItemFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature) Creates a new real-time ProcessQueueT with the default settings: ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateRealTimeQueue(ProcessQueueTProcessItemsFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature) Creates a new real-time, bulk item ProcessQueueT with the default settings: ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateRealTimeQueue(ProcessQueueTProcessItemFunctionSignature, Int32, Boolean, Boolean) Creates a new real-time ProcessQueueT using specified settings.
CreateRealTimeQueue(ProcessQueueTProcessItemsFunctionSignature, Int32, Boolean, Boolean) Creates a new real-time, bulk item ProcessQueueT using specified settings.
CreateRealTimeQueue(ProcessQueueTProcessItemFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Int32, Boolean, Boolean) Creates a new real-time ProcessQueueT using specified settings.
CreateRealTimeQueue(ProcessQueueTProcessItemsFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Int32, Boolean, Boolean) Creates a new real-time, bulk item ProcessQueueT using specified settings.
CreateSynchronousQueue(ProcessQueueTProcessItemFunctionSignature) Creates a new synchronous ProcessQueueT (i.e., single process thread) with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateSynchronousQueue(ProcessQueueTProcessItemsFunctionSignature) Creates a new synchronous, bulk item ProcessQueueT (i.e., single process thread) with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateSynchronousQueue(ProcessQueueTProcessItemFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature) Creates a new synchronous ProcessQueueT (i.e., single process thread) with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateSynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature) Creates a new synchronous, bulk item ProcessQueueT (i.e., single process thread) with the default settings: ProcessInterval = 100, ProcessTimeout = Infinite, RequeueOnTimeout = False, RequeueOnException = False.
CreateSynchronousQueue(ProcessQueueTProcessItemFunctionSignature, Double, Int32, Boolean, Boolean) Creates a new synchronous ProcessQueueT (i.e., single process thread) using specified settings.
CreateSynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, Double, Int32, Boolean, Boolean) Creates a new synchronous, bulk item ProcessQueueT (i.e., single process thread) using specified settings.
CreateSynchronousQueue(ProcessQueueTProcessItemFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Double, Int32, Boolean, Boolean) Creates a new synchronous ProcessQueueT (i.e., single process thread) using specified settings.
CreateSynchronousQueue(ProcessQueueTProcessItemsFunctionSignature, ProcessQueueTCanProcessItemFunctionSignature, Double, Int32, Boolean, Boolean) Creates a new synchronous, bulk item ProcessQueueT (i.e., single process thread) using specified settings.
DataAdded Notifies queue that data was added and/or modified, so it can begin processing data.
Dispose Releases all the resources used by the ProcessQueueT object.
Dispose(Boolean) Releases the unmanaged resources used by the ProcessQueueT object and optionally releases the managed resources.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
ExistsDetermines whether the ProcessQueueT contains elements that match the conditions defined by the specified predicate.
Finalize Releases the unmanaged resources before the ProcessQueueT object is reclaimed by GC.
(Overrides ObjectFinalize)
FindSearches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire ProcessQueueT.
FindAllRetrieves all elements that match the conditions defined by the specified predicate.
FindIndex(PredicateT)Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the ProcessQueueT that extends from the specified index to the last element.
FindIndex(Int32, PredicateT)Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the ProcessQueueT that extends from the specified index to the last element.
FindIndex(Int32, Int32, PredicateT)Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the ProcessQueueT that extends from the specified index to the last element.
FindLastSearches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire ProcessQueueT.
FindLastIndex(PredicateT)Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire ProcessQueueT.
FindLastIndex(Int32, PredicateT)Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the ProcessQueueT that extends from the first element to the specified index.
FindLastIndex(Int32, Int32, PredicateT)Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the ProcessQueueT that contains the specified number of elements and ends at the specified index.
Flush Blocks the current thread, if the ProcessQueueT is active (i.e., user has called "Start" method), until all items in ProcessQueueT are processed, and then stops the ProcessQueueT.
ForEachPerforms the specified action on each element of the ProcessQueueT.
GetEnumerator Returns an enumerator that iterates through the ProcessQueueT.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetRangeCreates a shallow copy of a range of elements in the source ProcessQueueT.
GetTypeGets the Type of the current instance.
(Inherited from Object)
IndexOf(T)Searches for the specified object and returns the zero-based index of the first occurrence within the entire ProcessQueueT.
IndexOf(T, Int32)Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ProcessQueueT that extends from the specified index to the last element.
IndexOf(T, Int32, Int32)Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ProcessQueueT that starts at the specified index and contains the specified number of elements.
InsertInserts an element into the ProcessQueueT at the specified index.
InsertRangeInserts the elements of a collection into the ProcessQueueT at the specified index.
LastIndexOf(T)Searches for the specified object and returns the zero-based index of the last occurrence within the entire ProcessQueueT.
LastIndexOf(T, Int32)Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the ProcessQueueT that extends from the first element to the specified index.
LastIndexOf(T, Int32, Int32)Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the ProcessQueueT that contains the specified number of elements and ends at the specified index.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
OnItemProcessed Raises the base class ItemProcessed event.
OnItemsProcessed Raises the base class ItemsProcessed event.
OnItemsTimedOut Raises the base class ItemsTimedOut event.
OnItemTimedOut Raises the base class ItemTimedOut event.
OnProcessException Raises the base class ProcessException event.
RemoveRemoves the first occurrence of a specific object from the ProcessQueueT.
RemoveAllRemoves the all the elements that match the conditions defined by the specified predicate.
RemoveAtRemoves the element at the specified index of the ProcessQueueT.
RemoveRangeRemoves a range of elements from the ProcessQueueT.
RequeueItem Requeues item into ProcessQueueT according to specified requeue reason.
RequeueItems Requeues items into ProcessQueueT according to specified requeue reason.
ReverseReverses the order of the elements in the entire ProcessQueueT.
Reverse(Int32, Int32)Reverses the order of the elements in the specified range.
SignalDataModified Manually signals that data has been modified and processing should resume.
SortSorts the elements in the entire ProcessQueueT, using the default comparer.
Sort(ComparisonT)Sorts the elements in the entire ProcessQueueT, using the specified comparison.
Sort(IComparerT)Sorts the elements in the entire ProcessQueueT, using the specified comparer.
Sort(Int32, Int32, IComparerT)Sorts the elements in a range of elements in the ProcessQueueT, using the specified comparer.
Start Starts item processing.
Stop Stops item processing.
ToArray Copies the elements contained in the ProcessQueueT to a new array.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TrueForAllDetermines whether every element in the ProcessQueueT matches the conditions defined by the specified predicate.
TryTake(T) Attempts to remove and return an object from the ProcessQueueT.
TryTake(T) Attempts to remove and return all objects from the ProcessQueueT.

Events

Disposed Occurs when the class has been disposed.
ItemProcessed Event that is raised after an item has been successfully processed.
ItemsProcessed Event that is raised after an array of items have been successfully processed.
ItemsTimedOut Event that is raised if the processing time for an array of items exceeds the specified process timeout.
ItemTimedOut Event that is raised if an item's processing time exceeds the specified process timeout.
ProcessException Event that is raised if an exception is encountered while attempting to processing an item in the ProcessQueueT.

Fields

DefaultMaximumThreads Default maximum number of processing threads.
DefaultProcessInterval Default processing interval (in milliseconds).
DefaultProcessTimeout Default processing timeout (in milliseconds).
DefaultRequeueModeOnException Default setting for requeuing mode on processing exceptions.
DefaultRequeueModeOnTimeout Default setting for requeuing mode on processing timeout.
DefaultRequeueOnException Default setting for requeuing items on processing exceptions.
DefaultRequeueOnTimeout Default setting for requeuing items on processing timeout.
RealTimeProcessInterval Default real-time processing interval (in milliseconds).

See Also