/// <summary> /// Initializes a new instance of the <see cref="PolygonDataQueueHandler"/> class /// </summary> public PolygonDataQueueHandler(bool streamingEnabled) { if (streamingEnabled) { foreach (var securityType in new[] { SecurityType.Equity, SecurityType.Forex, SecurityType.Crypto }) { var client = new PolygonWebSocketClientWrapper(_apiKey, _symbolMapper, securityType, OnMessage); _webSocketClientWrappers.Add(securityType, client); } } }
/// <summary> /// Initializes a new instance of the <see cref="PolygonDataQueueHandler"/> class /// </summary> public PolygonDataQueueHandler(bool streamingEnabled) { if (streamingEnabled) { foreach (var securityType in new[] { SecurityType.Equity, SecurityType.Forex, SecurityType.Crypto }) { var client = new PolygonWebSocketClientWrapper(_apiKey, _symbolMapper, securityType, OnMessage); _webSocketClientWrappers.Add(securityType, client); } } var subscriber = new EventBasedDataQueueHandlerSubscriptionManager(t => t.ToString()); subscriber.SubscribeImpl += Subscribe; subscriber.UnsubscribeImpl += Unsubscribe; _subscriptionManager = subscriber; }