Skip to content

IBusyCollection

QuantConnect.Interfaces.IBusyCollection

Bases: Generic[QuantConnect_Interfaces_IBusyCollection_T], IDisposable

Interface used to handle items being processed and communicate busy state

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_Interfaces_IBusyCollection_T,
) -> None
add(
    item: QuantConnect_Interfaces_IBusyCollection_T,
    cancellation_token: CancellationToken,
) -> None

Adds the items to this collection

Parameters:

Name Type Description Default
item QuantConnect_Interfaces_IBusyCollection_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_Interfaces_IBusyCollection_T]
)
get_consuming_enumerable(
    cancellation_token: CancellationToken,
) -> Iterable[QuantConnect_Interfaces_IBusyCollection_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_Interfaces_IBusyCollection_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