private async Task <Dictionary <SubscriptionInfo, StockQueryResult> > GetSubscriptionNeedRefreshing(IList <SubscriptionInfo> subscriptions) { var results = new Dictionary <SubscriptionInfo, StockQueryResult>(); foreach (var info in subscriptions) { IQueryContext queryContext = info.Query.CreateContext(_contextFactory); StockQueryResult queryResult = await queryContext.GetCachedQueryResult(info.Query.SymbolId); bool queryNeedsRefresh = queryResult == null || info.Query.FunctionType.IsExpired(queryResult.Data.LastUpdated, DateTime.UtcNow); if (queryNeedsRefresh) { results.Add(info, queryResult); } } return(results); }
internal void RegisterLoser(StockQueryResult entry) { _loser = entry; }
internal void RegisterGainer(StockQueryResult entry) { _gainer = entry; }
internal void RegisterActive(StockQueryResult entry) { _active = entry; }
private Task <List <StockQueryResult> > Get(StockQueryResult result) { return(Task.FromResult(new List <StockQueryResult> { result })); }
public void PublishStockQueuedResponse(StockQueryResult message) { this.Publish(message, this._connectionSettings.StockRequestCalculationResponseQueu, "amq.fanout"); }