Skip to content

BusyCollection

QuantConnect.Util.BusyCollection

Bases: Generic[QuantConnect_Util_BusyCollection_T], Object, IBusyCollection[QuantConnect_Util_BusyCollection_T]

A non blocking IBusyCollection{T} implementation

wait_handle

wait_handle: WaitHandle

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

count

count: int

Gets the number of items held within this collection

is_busy

is_busy: bool

Returns true if processing, false otherwise

add

add(item: QuantConnect_Util_BusyCollection_T) -> None
add(
    item: QuantConnect_Util_BusyCollection_T,
    cancellation_token: CancellationToken,
) -> None

Adds the items to this collection

Parameters:

Name Type Description Default
item QuantConnect_Util_BusyCollection_T

The item to be added

required
cancellation_token Optional[CancellationToken]

A cancellation token to observer

None

get_consuming_enumerable

get_consuming_enumerable() -> (
    Iterable[QuantConnect_Util_BusyCollection_T]
)
get_consuming_enumerable(
    cancellation_token: CancellationToken,
) -> Iterable[QuantConnect_Util_BusyCollection_T]

Provides a consuming enumerable for items in this collection.

Parameters:

Name Type Description Default
cancellation_token Optional[CancellationToken]

A cancellation token to observer

None

Returns:

Type Description
Iterable[QuantConnect_Util_BusyCollection_T]

An enumerable that removes and returns items from the collection.

complete_adding

complete_adding() -> None

Marks the collection as not accepting any more additions

dispose

dispose() -> None

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