Lean  $LEAN_TAG$
QuantConnect.Util.WorkerThread Class Reference

This worker tread is required to guarantee all python operations are executed by the same thread, to enable complete debugging functionality. We don't use the main thread, to avoid any chance of blocking the process More...

Inheritance diagram for QuantConnect.Util.WorkerThread:
[legend]

Public Member Functions

void Add (Action action)
 Adds a new item of work More...
 
void Dispose ()
 Disposes the worker thread. More...
 

Static Public Attributes

static WorkerThread Instance = new WorkerThread()
 The worker thread instance More...
 

Protected Member Functions

 WorkerThread ()
 Creates a new instance, which internally launches a new worker thread More...
 

Properties

AutoResetEvent FinishedWorkItem [get]
 Will be set when the worker thread finishes a work item More...
 

Detailed Description

This worker tread is required to guarantee all python operations are executed by the same thread, to enable complete debugging functionality. We don't use the main thread, to avoid any chance of blocking the process

Definition at line 28 of file WorkerThread.cs.

Constructor & Destructor Documentation

◆ WorkerThread()

QuantConnect.Util.WorkerThread.WorkerThread ( )
protected

Creates a new instance, which internally launches a new worker thread

Dispose

Definition at line 48 of file WorkerThread.cs.

Here is the call graph for this function:

Member Function Documentation

◆ Add()

void QuantConnect.Util.WorkerThread.Add ( Action  action)

Adds a new item of work

Parameters
actionThe work item to add

Definition at line 88 of file WorkerThread.cs.

◆ Dispose()

void QuantConnect.Util.WorkerThread.Dispose ( )

Disposes the worker thread.

Note that the worker thread is a background thread, so it won't block the process from terminating even if not disposed

Definition at line 98 of file WorkerThread.cs.

Here is the call graph for this function:

Member Data Documentation

◆ Instance

WorkerThread QuantConnect.Util.WorkerThread.Instance = new WorkerThread()
static

The worker thread instance

Definition at line 37 of file WorkerThread.cs.

Property Documentation

◆ FinishedWorkItem

AutoResetEvent QuantConnect.Util.WorkerThread.FinishedWorkItem
get

Will be set when the worker thread finishes a work item

Definition at line 42 of file WorkerThread.cs.


The documentation for this class was generated from the following file: