Lean  $LEAN_TAG$
QuantConnect.Util.BusyBlockingCollection< T > Class Template Reference

A small wrapper around BlockingCollection<T> used to communicate busy state of the items being processed More...

Inheritance diagram for QuantConnect.Util.BusyBlockingCollection< T >:
[legend]

Public Member Functions

 BusyBlockingCollection ()
 Initializes a new instance of the BusyBlockingCollection<T> class with a bounded capacity of int.MaxValue More...
 
 BusyBlockingCollection (int boundedCapacity)
 Initializes a new instance of the BusyBlockingCollection<T> class with the specified boundedCapacity More...
 
void Add (T item)
 Adds the items to this collection More...
 
void Add (T item, CancellationToken cancellationToken)
 Adds the items to this collection More...
 
void CompleteAdding ()
 Marks the BusyBlockingCollection<T> as not accepting any more additions More...
 
IEnumerable< T > GetConsumingEnumerable ()
 Provides a consuming enumerable for items in this collection. More...
 
IEnumerable< T > GetConsumingEnumerable (CancellationToken cancellationToken)
 Provides a consuming enumerable for items in this collection. More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 

Properties

WaitHandle WaitHandle [get]
 Gets a wait handle that can be used to wait until this instance is done processing all of it's item More...
 
int Count [get]
 Gets the number of items held within this collection More...
 
bool IsBusy [get]
 Returns true if processing, false otherwise More...
 
- Properties inherited from QuantConnect.Interfaces.IBusyCollection< T >
WaitHandle WaitHandle [get]
 Gets a wait handle that can be used to wait until this instance is done processing all of it's item More...
 
int Count [get]
 Gets the number of items held within this collection More...
 
bool IsBusy [get]
 Returns true if processing, false otherwise More...
 

Detailed Description

A small wrapper around BlockingCollection<T> used to communicate busy state of the items being processed

Template Parameters
TThe item type being processed

Definition at line 30 of file BusyBlockingCollection.cs.

Constructor & Destructor Documentation

◆ BusyBlockingCollection() [1/2]

Initializes a new instance of the BusyBlockingCollection<T> class with a bounded capacity of int.MaxValue

Definition at line 71 of file BusyBlockingCollection.cs.

◆ BusyBlockingCollection() [2/2]

Initializes a new instance of the BusyBlockingCollection<T> class with the specified boundedCapacity

Parameters
boundedCapacityThe maximum number of items allowed in the collection

Definition at line 81 of file BusyBlockingCollection.cs.

Member Function Documentation

◆ Add() [1/2]

void QuantConnect.Util.BusyBlockingCollection< T >.Add ( item)

Adds the items to this collection

Parameters
itemThe item to be added

Implements QuantConnect.Interfaces.IBusyCollection< T >.

Definition at line 93 of file BusyBlockingCollection.cs.

◆ Add() [2/2]

void QuantConnect.Util.BusyBlockingCollection< T >.Add ( item,
CancellationToken  cancellationToken 
)

Adds the items to this collection

Parameters
itemThe item to be added
cancellationTokenA cancellation token to observer

Implements QuantConnect.Interfaces.IBusyCollection< T >.

Definition at line 103 of file BusyBlockingCollection.cs.

◆ CompleteAdding()

void QuantConnect.Util.BusyBlockingCollection< T >.CompleteAdding ( )

Marks the BusyBlockingCollection<T> as not accepting any more additions

Implements QuantConnect.Interfaces.IBusyCollection< T >.

Definition at line 122 of file BusyBlockingCollection.cs.

◆ GetConsumingEnumerable() [1/2]

IEnumerable<T> QuantConnect.Util.BusyBlockingCollection< T >.GetConsumingEnumerable ( )

Provides a consuming enumerable for items in this collection.

Returns
An enumerable that removes and returns items from the collection

Implements QuantConnect.Interfaces.IBusyCollection< T >.

Definition at line 131 of file BusyBlockingCollection.cs.

◆ GetConsumingEnumerable() [2/2]

IEnumerable<T> QuantConnect.Util.BusyBlockingCollection< T >.GetConsumingEnumerable ( CancellationToken  cancellationToken)

Provides a consuming enumerable for items in this collection.

Parameters
cancellationTokenA cancellation token to observer
Returns
An enumerable that removes and returns items from the collection

Implements QuantConnect.Interfaces.IBusyCollection< T >.

Definition at line 141 of file BusyBlockingCollection.cs.

◆ Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

<filterpriority>2</filterpriority>

Definition at line 208 of file BusyBlockingCollection.cs.

Property Documentation

◆ WaitHandle

WaitHandle QuantConnect.Util.BusyBlockingCollection< T >.WaitHandle
get

Gets a wait handle that can be used to wait until this instance is done processing all of it's item

Definition at line 41 of file BusyBlockingCollection.cs.

◆ Count

Gets the number of items held within this collection

Definition at line 49 of file BusyBlockingCollection.cs.

◆ IsBusy

Returns true if processing, false otherwise

Definition at line 57 of file BusyBlockingCollection.cs.


The documentation for this class was generated from the following file: