BaseSubscriptionDataSourceReader
QuantConnect.Lean.Engine.DataFeeds.BaseSubscriptionDataSourceReader
BaseSubscriptionDataSourceReader(
data_cache_provider: IDataCacheProvider,
is_live_mode: bool,
object_store: IObjectStore,
)
Bases: Object, ISubscriptionDataSourceReader
A base class for implementations of the ISubscriptionDataSourceReader
Creates a new instance
This codeEntityType is protected.
is_live_mode
is_live_mode: bool
True if we're in live mode, false for backtesting
This codeEntityType is protected.
data_cache_provider
data_cache_provider: IDataCacheProvider
The data cache provider to use
This codeEntityType is protected.
invalid_source
invalid_source: _EventContainer[
Callable[[Object, InvalidSourceEventArgs], Any], Any
]
Event fired when the specified source is considered invalid, this may be from a missing file or failure to download a remote source
create_stream_reader
create_stream_reader(
subscription_data_source: SubscriptionDataSource,
) -> IStreamReader
Creates a new IStreamReader for the specified subscription_data_source
This codeEntityType is protected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_data_source
|
SubscriptionDataSource
|
The source to produce an IStreamReader for |
required |
Returns:
| Type | Description |
|---|---|
IStreamReader
|
A new instance of IStreamReader to read the source, or null if there was an error. |
on_invalid_source
on_invalid_source(
source: SubscriptionDataSource, exception: Exception
) -> None
Event invocator for the invalid_source event
This codeEntityType is protected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
SubscriptionDataSource
|
The SubscriptionDataSource that was invalid |
required |
exception
|
Exception
|
The exception if one was raised, otherwise null |
required |
read
read(source: SubscriptionDataSource) -> Iterable[BaseData]
Reads the specified source
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
SubscriptionDataSource
|
The source to be read |
required |
Returns:
| Type | Description |
|---|---|
Iterable[BaseData]
|
An IEnumerable{BaseData} that contains the data in the source. |