Exemple #1
0
 public PortfolioAggregator(UserContext context)
 {
     _id           = ObjectId.NewObjectId();
     TimerInterval = 15000;
     Context       = context;
     _scanners     = new List <PortfolioProvider>();
     M.Register <QuoteAssetChangedMessage>(this, BaseAssetChanged);
     _debouncer = new Debouncer();
     _timer     = new TimerIrregular(TimeSpan.FromSeconds(30), KeepPricesSubscriptionAlive);
     _keepAlive = new LatestPriceRequestSubscription(_id);
 }
Exemple #2
0
        private void QuickFindPrice(LatestPriceRequestSubscription message)
        {
            if (message.Pair == null || message.SubscriptionType != SubscriptionType.Subscribe)
            {
                return;
            }

            var r = FinanceCommon.I.Aggregator.Results().FirstOrDefault(x => x.Pair.Equals(message.Pair));

            if (r != null)
            {
                M.SendAsync(r);
            }
        }