Table of Contents

Class BusyCollection<T>

Namespace
FinanceSharp
Assembly
FinanceSharp.dll

A non blocking IBusyCollection<T> implementation

public class BusyCollection<T> : IBusyCollection<T>, IDisposable

Type Parameters

T

The 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

int

IsBusy

Returns true if processing, false otherwise

public bool IsBusy { get; }

Property Value

bool

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

WaitHandle

Methods

Add(T)

Adds the items to this collection

public void Add(T item)

Parameters

item T

The item to be added

Add(T, CancellationToken)

Adds the items to this collection

public void Add(T item, CancellationToken cancellationToken)

Parameters

item T

The item to be added

cancellationToken CancellationToken

A 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

cancellationToken CancellationToken

A cancellation token to observer

Returns

IEnumerable<T>

An enumerable that removes and returns items from the collection