Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange Class Reference

Provides a means of distributing output from enumerators from a dedicated separate thread More...

Classes

class  EnumeratorHandler
 Handler used to manage a single enumerator's move next/end of stream behavior More...
 

Public Member Functions

 BaseDataExchange (string name)
 Initializes a new instance of the BaseDataExchange More...
 
void AddEnumerator (EnumeratorHandler handler)
 Adds the enumerator to this exchange. If it has already been added then it will remain registered in the exchange only once More...
 
void AddEnumerator (Symbol symbol, IEnumerator< BaseData > enumerator, Func< bool > shouldMoveNext=null, Action< EnumeratorHandler > enumeratorFinished=null, Action< BaseData > handleData=null)
 Adds the enumerator to this exchange. If it has already been added then it will remain registered in the exchange only once More...
 
void SetErrorHandler (Func< Exception, bool > isFatalError)
 Sets the specified function as the error handler. This function returns true if it is a fatal error and queue consumption should cease. More...
 
EnumeratorHandler RemoveEnumerator (Symbol symbol)
 Removes and returns enumerator handler with the specified symbol. The removed handler is returned, null if not found More...
 
void Start ()
 Begins consumption of the wrapped IDataQueueHandler on a separate thread More...
 
void Stop ()
 Ends consumption of the wrapped IDataQueueHandler More...
 

Properties

uint SleepInterval [get, set]
 Gets or sets how long this thread will sleep when no data is available More...
 
string Name [get]
 Gets a name for this exchange More...
 

Detailed Description

Provides a means of distributing output from enumerators from a dedicated separate thread

Definition at line 31 of file BaseDataExchange.cs.

Constructor & Destructor Documentation

◆ BaseDataExchange()

QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.BaseDataExchange ( string  name)

Initializes a new instance of the BaseDataExchange

Parameters
nameA name for this exchange

Definition at line 70 of file BaseDataExchange.cs.

Member Function Documentation

◆ AddEnumerator() [1/2]

void QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.AddEnumerator ( EnumeratorHandler  handler)

Adds the enumerator to this exchange. If it has already been added then it will remain registered in the exchange only once

Parameters
handlerThe handler to use when this symbol's data is encountered

Definition at line 84 of file BaseDataExchange.cs.

Here is the caller graph for this function:

◆ AddEnumerator() [2/2]

void QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.AddEnumerator ( Symbol  symbol,
IEnumerator< BaseData enumerator,
Func< bool >  shouldMoveNext = null,
Action< EnumeratorHandler enumeratorFinished = null,
Action< BaseData handleData = null 
)

Adds the enumerator to this exchange. If it has already been added then it will remain registered in the exchange only once

Parameters
symbolA unique symbol used to identify this enumerator
enumeratorThe enumerator to be added
shouldMoveNextFunction used to determine if move next should be called on this enumerator, defaults to always returning true
enumeratorFinishedDelegate called when the enumerator move next returns false
handleDataHandler for data if HandlesData=true

Definition at line 100 of file BaseDataExchange.cs.

Here is the call graph for this function:

◆ SetErrorHandler()

void QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.SetErrorHandler ( Func< Exception, bool >  isFatalError)

Sets the specified function as the error handler. This function returns true if it is a fatal error and queue consumption should cease.

Parameters
isFatalErrorThe error handling function to use when an error is encountered during queue consumption. Returns true if queue consumption should be stopped, returns false if queue consumption should continue

Definition at line 119 of file BaseDataExchange.cs.

◆ RemoveEnumerator()

EnumeratorHandler QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.RemoveEnumerator ( Symbol  symbol)

Removes and returns enumerator handler with the specified symbol. The removed handler is returned, null if not found

Definition at line 129 of file BaseDataExchange.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Start()

void QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.Start ( )

Begins consumption of the wrapped IDataQueueHandler on a separate thread

Definition at line 144 of file BaseDataExchange.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stop()

void QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.Stop ( )

Ends consumption of the wrapped IDataQueueHandler

Definition at line 162 of file BaseDataExchange.cs.

Here is the caller graph for this function:

Property Documentation

◆ SleepInterval

uint QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.SleepInterval
getset

Gets or sets how long this thread will sleep when no data is available

Definition at line 46 of file BaseDataExchange.cs.

◆ Name

string QuantConnect.Lean.Engine.DataFeeds.BaseDataExchange.Name
get

Gets a name for this exchange

Definition at line 62 of file BaseDataExchange.cs.


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