Lean
$LEAN_TAG$
|
Isolator class - create a new instance of the algorithm and ensure it doesn't exceed memory or time execution limits. More...
Public Member Functions | |
Isolator () | |
Initializes a new instance of the Isolator class More... | |
bool | ExecuteWithTimeLimit (TimeSpan timeSpan, Func< IsolatorLimitResult > withinCustomLimits, Action codeBlock, long memoryCap=1024, int sleepIntervalMillis=1000, WorkerThread workerThread=null) |
Execute a code block with a maximum limit on time and memory. More... | |
bool | ExecuteWithTimeLimit (TimeSpan timeSpan, Action codeBlock, long memoryCap, int sleepIntervalMillis=1000, WorkerThread workerThread=null) |
Execute a code block with a maximum limit on time and memory. More... | |
Properties | |
CancellationTokenSource | CancellationTokenSource [get] |
Algo cancellation controls - cancel source. More... | |
Isolator class - create a new instance of the algorithm and ensure it doesn't exceed memory or time execution limits.
Definition at line 28 of file Isolator.cs.
QuantConnect.Isolator.Isolator | ( | ) |
Initializes a new instance of the Isolator class
Definition at line 41 of file Isolator.cs.
bool QuantConnect.Isolator.ExecuteWithTimeLimit | ( | TimeSpan | timeSpan, |
Func< IsolatorLimitResult > | withinCustomLimits, | ||
Action | codeBlock, | ||
long | memoryCap = 1024 , |
||
int | sleepIntervalMillis = 1000 , |
||
WorkerThread | workerThread = null |
||
) |
Execute a code block with a maximum limit on time and memory.
timeSpan | Timeout in timespan |
withinCustomLimits | Function used to determine if the codeBlock is within custom limits, such as with algorithm manager timing individual time loops, return a non-null and non-empty string with a message indicating the error/reason for stoppage |
codeBlock | Action codeblock to execute |
memoryCap | Maximum memory allocation, default 1024Mb |
sleepIntervalMillis | Sleep interval between each check in ms |
workerThread | The worker thread instance that will execute the provided action, if null will use a Task |
Definition at line 58 of file Isolator.cs.
bool QuantConnect.Isolator.ExecuteWithTimeLimit | ( | TimeSpan | timeSpan, |
Action | codeBlock, | ||
long | memoryCap, | ||
int | sleepIntervalMillis = 1000 , |
||
WorkerThread | workerThread = null |
||
) |
Execute a code block with a maximum limit on time and memory.
timeSpan | Timeout in timespan |
codeBlock | Action codeblock to execute |
memoryCap | Maximum memory allocation, default 1024Mb |
sleepIntervalMillis | Sleep interval between each check in ms |
workerThread | The worker thread instance that will execute the provided action, if null will use a Task |
Definition at line 194 of file Isolator.cs.
|
get |
Algo cancellation controls - cancel source.
Definition at line 34 of file Isolator.cs.