public PriceRequestManager(ILogger <PriceRequestManager> logger, IProducer <PriceMessage> producer, IMarketClient markets) { _logger = logger; _producer = producer; _markets = markets; }
public CandleRequestManager(IOptions <Config> config, ILogger <CandleRequestManager> logger, IMarketClient markets, IProducer <CandleMessage> producer) { _config = config.Value; _logger = logger; _markets = markets; _producer = producer; }
private async Task UpdateOneClientAsync(IMarketClient client, ICoinBuilder builder) { if (this._exchanges.TryGetValue(key: client.Name, out Exchange? exchange)) { this.Logger.LogInformation($"Start updating exchange '{client.Name}'."); Stopwatch watch = new Stopwatch(); watch.Start(); IReadOnlyCollection <MarketSummaryDto> markets; try { markets = await client.GetAsync(builder); } catch (Exception e) { this.Logger.LogError(eventId: 0, exception: e, $"An error occurred while fetching results from the exchange '{client.Name}'."); exchange.Lock.EnterWriteLock(); try { // Remove out-of-date market summaries exchange.Markets = Array.Empty <MarketSummaryDto>(); } finally { exchange.Lock.ExitWriteLock(); } return; } // Update market summaries exchange.Lock.EnterWriteLock(); try { exchange.Markets = markets; watch.Stop(); this.Logger.LogInformation($"Finished updating exchange '{client.Name}' in {watch.ElapsedMilliseconds}ms."); } finally { exchange.Lock.ExitWriteLock(); } }
public PrimInterperator(LoginInfo loginInfo) { marketClient = new Poster(loginInfo); }
public ESIClient(IStatusClient status, IMarketClient market) { Status = status; Market = market; }
public MarketController(IOptions <Config> config, IMarketClient client, ILogger <MarketController> logger) { _client = client; _logger = logger; _config = config.Value; }