Class BusyCollection<T>
- Namespace
- FinanceSharp
- Assembly
- FinanceSharp.dll
A non blocking IBusyCollection<T> implementation
public class BusyCollection<T> : IBusyCollection<T>, IDisposable
Type Parameters
TThe item type being processed
- Inheritance
-
BusyCollection<T>
- Implements
- Inherited Members
- Extension Methods
Properties
Count
Gets the number of items held within this collection
public int Count { get; }
Property Value
IsBusy
Returns true if processing, false otherwise
public bool IsBusy { get; }
Property Value
WaitHandle
Gets a wait handle that can be used to wait until this instance is done processing all of it's item
public WaitHandle WaitHandle { get; }
Property Value
Methods
Add(T)
Adds the items to this collection
public void Add(T item)
Parameters
itemTThe item to be added
Add(T, CancellationToken)
Adds the items to this collection
public void Add(T item, CancellationToken cancellationToken)
Parameters
itemTThe item to be added
cancellationTokenCancellationTokenA cancellation token to observer
CompleteAdding()
Marks the collection as not accepting any more additions
public void CompleteAdding()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetConsumingEnumerable()
Provides a consuming enumerable for items in this collection.
public IEnumerable<T> GetConsumingEnumerable()
Returns
- IEnumerable<T>
An enumerable that removes and returns items from the collection
GetConsumingEnumerable(CancellationToken)
Provides a consuming enumerable for items in this collection.
public IEnumerable<T> GetConsumingEnumerable(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA cancellation token to observer
Returns
- IEnumerable<T>
An enumerable that removes and returns items from the collection