Example #1
0
        internal RTDataRec GetRTDataRec(string Symbol, string ClusterName, bool Create = true)
        {
            RTDataRec Rec;

            if (!RTDataDict.TryGetValue(Symbol, out Rec) && Create)
            {
                Rec = new RTDataRec(Symbol, ClusterName);
                RTDataDict[Symbol] = Rec;

                OnSubscribedSymbolEvent?.Invoke(Rec);
                Rec.RequestLast = true;
            }
            return(Rec);
        }
Example #2
0
        internal void OnSubscribe(string ClusterName, Dictionary <string, SubscribeSymbolRec> SubscribedSymbols)
        {
            var SubscribedSymbolsCopy = new Dictionary <string, SubscribeSymbolRec>(SubscribedSymbols);

            foreach (var kvPair in SubscribedSymbolsCopy)
            {
                string             Symbol       = kvPair.Key;
                SubscribeSymbolRec SubscribeRec = kvPair.Value;

                if (SubscribeRec.IsNew)
                {
                    RTDataRec Rec = GetRTDataRec(Symbol, ClusterName);
                    OnSubscribedSymbolEvent?.Invoke(Rec);
                }
            }
        }