EnqueueableEnumerator
QuantConnect.Lean.Engine.DataFeeds.Enumerators.EnqueueableEnumerator
EnqueueableEnumerator(blocking: bool = False)
Bases: Generic[QuantConnect_Lean_Engine_DataFeeds_Enumerators_EnqueueableEnumerator_T], Object, IEnumerator[QuantConnect_Lean_Engine_DataFeeds_Enumerators_EnqueueableEnumerator_T]
An implementation of IEnumerator{T} that relies on the enqueue method being called and only ends when stop is called
Initializes a new instance of the EnqueueableEnumerator{T} class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blocking
|
bool
|
Specifies whether or not to use the blocking behavior |
False
|
count
count: int
Gets the current number of items held in the internal queue
has_finished
has_finished: bool
Returns true if the enumerator has finished and will not accept any more data
current
current: QuantConnect_Lean_Engine_DataFeeds_Enumerators_EnqueueableEnumerator_T
Gets the element in the collection at the current position of the enumerator.
dispose
dispose() -> None
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
enqueue
enqueue(
data: QuantConnect_Lean_Engine_DataFeeds_Enumerators_EnqueueableEnumerator_T,
) -> None
Enqueues the new data into this enumerator
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
QuantConnect_Lean_Engine_DataFeeds_Enumerators_EnqueueableEnumerator_T
|
The data to be enqueued |
required |
move_next
move_next() -> bool
Advances the enumerator to the next element of the collection.
Returns:
| Type | Description |
|---|---|
bool
|
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. |
reset
reset() -> None
Sets the enumerator to its initial position, which is before the first element in the collection.
stop
stop() -> None
Signals the enumerator to stop enumerating when the items currently held inside are gone. No more items will be added to this enumerator.