DiskDataCacheProvider
QuantConnect.Data.DiskDataCacheProvider
DiskDataCacheProvider()
DiskDataCacheProvider(locker: KeyStringSynchronizer)
Bases: Object, IDataCacheProvider
Simple data cache provider, writes and reads directly from disk Used as default for LeanDataWriter
Signature descriptions:
-
Creates a new instance
-
Creates a new instance using the given synchronizer
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
locker
|
Optional[KeyStringSynchronizer]
|
The synchronizer instance to use |
None
|
is_data_ephemeral
is_data_ephemeral: bool
Property indicating the data is temporary in nature and should not be cached.
dispose
dispose() -> None
Dispose for this class
fetch
fetch(key: str) -> Stream
Fetch data from the cache
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
A string representing the key of the cached data |
required |
Returns:
| Type | Description |
|---|---|
Stream
|
An Stream of the cached data. |
get_zip_entries
get_zip_entries(zip_file: str) -> List[str]
Returns a list of zip entries in a provided zip file
store
store(key: str, data: List[int]) -> None
Store the data in the cache. Not implemented in this instance of the IDataCacheProvider
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The source of the data, used as a key to retrieve data in the cache |
required |
data
|
List[int]
|
The data as a byte array |
required |