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

A non blocking IBusyCollection<T> implementation More...

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

Public Member Functions

void Add (T item)
 Adds the items to this collection More...
 
void Add (T item, CancellationToken cancellationToken)
 Adds the items to this collection 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...
 
void CompleteAdding ()
 Marks the collection as not accepting any more additions More...
 

Public Attributes

WaitHandle WaitHandle => _processingCompletedEvent.WaitHandle
 Gets a wait handle that can be used to wait until this instance is done processing all of it's item More...
 
int Count => _collection.Count
 Gets the number of items held within this collection More...
 
bool IsBusy => !_collection.IsEmpty || !_processingCompletedEvent.IsSet
 Returns true if processing, false otherwise More...
 

Additional Inherited Members

- 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 non blocking IBusyCollection<T> implementation

Template Parameters
TThe item type being processed

Definition at line 29 of file BusyCollection.cs.

Member Function Documentation

◆ Add() [1/2]

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

Adds the items to this collection

Parameters
itemThe item to be added

Implements QuantConnect.Interfaces.IBusyCollection< T >.

Definition at line 55 of file BusyCollection.cs.

◆ Add() [2/2]

void QuantConnect.Util.BusyCollection< 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 65 of file BusyCollection.cs.

◆ GetConsumingEnumerable() [1/2]

IEnumerable<T> QuantConnect.Util.BusyCollection< 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 86 of file BusyCollection.cs.

◆ GetConsumingEnumerable() [2/2]

IEnumerable<T> QuantConnect.Util.BusyCollection< 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 96 of file BusyCollection.cs.

◆ Dispose()

void QuantConnect.Util.BusyCollection< T >.Dispose ( )

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

<filterpriority>2</filterpriority>

Definition at line 118 of file BusyCollection.cs.

◆ CompleteAdding()

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

Marks the collection as not accepting any more additions

Implements QuantConnect.Interfaces.IBusyCollection< T >.

Definition at line 127 of file BusyCollection.cs.

Member Data Documentation

◆ WaitHandle

WaitHandle QuantConnect.Util.BusyCollection< T >.WaitHandle => _processingCompletedEvent.WaitHandle

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

Definition at line 39 of file BusyCollection.cs.

◆ Count

int QuantConnect.Util.BusyCollection< T >.Count => _collection.Count

Gets the number of items held within this collection

Definition at line 44 of file BusyCollection.cs.

◆ IsBusy

bool QuantConnect.Util.BusyCollection< T >.IsBusy => !_collection.IsEmpty || !_processingCompletedEvent.IsSet

Returns true if processing, false otherwise

Definition at line 49 of file BusyCollection.cs.


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