|
Lean
$LEAN_TAG$
|
Handles brokerage data subscriptions with multiple websocket connections, with optional symbol weighting More...
Public Member Functions | |
| BrokerageMultiWebSocketSubscriptionManager (string webSocketUrl, int maximumSymbolsPerWebSocket, int maximumWebSocketConnections, Dictionary< Symbol, int > symbolWeights, Func< WebSocketClientWrapper > webSocketFactory, Func< IWebSocket, Symbol, bool > subscribeFunc, Func< IWebSocket, Symbol, bool > unsubscribeFunc, Action< WebSocketMessage > messageHandler, TimeSpan webSocketConnectionDuration, RateGate connectionRateLimiter=null) | |
| Initializes a new instance of the BrokerageMultiWebSocketSubscriptionManager class More... | |
| override void | Dispose () |
| Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Public Member Functions inherited from QuantConnect.Data.EventBasedDataQueueHandlerSubscriptionManager | |
| EventBasedDataQueueHandlerSubscriptionManager () | |
| Creates an instance of EventBasedDataQueueHandlerSubscriptionManager with a single channel name More... | |
| EventBasedDataQueueHandlerSubscriptionManager (Func< TickType, string > getChannelName) | |
| Creates an instance of EventBasedDataQueueHandlerSubscriptionManager More... | |
Public Member Functions inherited from QuantConnect.Data.DataQueueHandlerSubscriptionManager | |
| void | Subscribe (SubscriptionDataConfig dataConfig) |
| Increment number of subscribers for current TickType More... | |
| void | Unsubscribe (SubscriptionDataConfig dataConfig) |
| Decrement number of subscribers for current TickType More... | |
| IEnumerable< Symbol > | GetSubscribedSymbols () |
| Returns subscribed symbols More... | |
| IEnumerable< Symbol > | GetSubscribedSymbols (TickType tickType) |
| Retrieves the list of unique Symbol instances that are currently subscribed for a specific TickType. More... | |
| bool | IsSubscribed (Symbol symbol, TickType tickType) |
| Checks if there is existing subscriber for current channel More... | |
Protected Member Functions | |
| override bool | Subscribe (IEnumerable< Symbol > symbols, TickType tickType) |
| Subscribes to the symbols More... | |
| override bool | Unsubscribe (IEnumerable< Symbol > symbols, TickType tickType) |
| Unsubscribes from the symbols More... | |
Protected Member Functions inherited from QuantConnect.Data.EventBasedDataQueueHandlerSubscriptionManager | |
| override bool | Subscribe (IEnumerable< Symbol > symbols, TickType tickType) |
| The way Brokerage subscribes to symbol tickers More... | |
| override bool | Unsubscribe (IEnumerable< Symbol > symbols, TickType tickType) |
| The way Brokerage unsubscribes from symbol tickers More... | |
| override string | ChannelNameFromTickType (TickType tickType) |
| Channel name More... | |
Additional Inherited Members | |
Properties inherited from QuantConnect.Data.EventBasedDataQueueHandlerSubscriptionManager | |
| Func< IEnumerable< Symbol >, TickType, bool > | SubscribeImpl [get, set] |
| Subscription method implementation More... | |
| Func< IEnumerable< Symbol >, TickType, bool > | UnsubscribeImpl [get, set] |
| Unsubscription method implementation More... | |
Properties inherited from QuantConnect.Data.DataQueueHandlerSubscriptionManager | |
| ConcurrentDictionary< Channel, int > | SubscribersByChannel = new ConcurrentDictionary<Channel, int>() [get] |
| Counter More... | |
Handles brokerage data subscriptions with multiple websocket connections, with optional symbol weighting
Definition at line 31 of file BrokerageMultiWebSocketSubscriptionManager.cs.
| QuantConnect.Brokerages.BrokerageMultiWebSocketSubscriptionManager.BrokerageMultiWebSocketSubscriptionManager | ( | string | webSocketUrl, |
| int | maximumSymbolsPerWebSocket, | ||
| int | maximumWebSocketConnections, | ||
| Dictionary< Symbol, int > | symbolWeights, | ||
| Func< WebSocketClientWrapper > | webSocketFactory, | ||
| Func< IWebSocket, Symbol, bool > | subscribeFunc, | ||
| Func< IWebSocket, Symbol, bool > | unsubscribeFunc, | ||
| Action< WebSocketMessage > | messageHandler, | ||
| TimeSpan | webSocketConnectionDuration, | ||
| RateGate | connectionRateLimiter = null |
||
| ) |
Initializes a new instance of the BrokerageMultiWebSocketSubscriptionManager class
| webSocketUrl | The URL for websocket connections |
| maximumSymbolsPerWebSocket | The maximum number of symbols per websocket connection |
| maximumWebSocketConnections | The maximum number of websocket connections allowed (if zero, symbol weighting is disabled) |
| symbolWeights | A dictionary for the symbol weights |
| webSocketFactory | A function which returns a new websocket instance |
| subscribeFunc | A function which subscribes a symbol |
| unsubscribeFunc | A function which unsubscribes a symbol |
| messageHandler | The websocket message handler |
| webSocketConnectionDuration | The maximum duration of the websocket connection, TimeSpan.Zero for no duration limit |
| connectionRateLimiter | The rate limiter for creating new websocket connections |
Definition at line 61 of file BrokerageMultiWebSocketSubscriptionManager.cs.
|
protectedvirtual |
Subscribes to the symbols
| symbols | Symbols to subscribe |
| tickType | Type of tick data |
Implements QuantConnect.Data.DataQueueHandlerSubscriptionManager.
Definition at line 135 of file BrokerageMultiWebSocketSubscriptionManager.cs.
|
protectedvirtual |
Unsubscribes from the symbols
| symbols | Symbols to subscribe |
| tickType | Type of tick data |
Implements QuantConnect.Data.DataQueueHandlerSubscriptionManager.
Definition at line 156 of file BrokerageMultiWebSocketSubscriptionManager.cs.
|
virtual |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Reimplemented from QuantConnect.Data.DataQueueHandlerSubscriptionManager.
Definition at line 179 of file BrokerageMultiWebSocketSubscriptionManager.cs.