public async Task ExecuteAsync(IFundingServiceContext fundingServiceContext, CancellationToken cancellationToken) { var stopWatch = new Stopwatch(); stopWatch.Start(); var stopWatchSteps = new Stopwatch(); stopWatchSteps.Start(); var message = await _ilrFileProviderService.ProvideAsync(fundingServiceContext, cancellationToken).ConfigureAwait(false); _logger.LogDebug($"Funding Service got file in: {stopWatchSteps.ElapsedMilliseconds}"); stopWatchSteps.Restart(); cancellationToken.ThrowIfCancellationRequested(); var refereceData = await _ilrReferenceDataProviderService.ProvideAsync(fundingServiceContext, cancellationToken).ConfigureAwait(false); cancellationToken.ThrowIfCancellationRequested(); stopWatchSteps.Restart(); cancellationToken.ThrowIfCancellationRequested(); string externalDataCache = _jsonSerializationService.Serialize(_externalCachePopulationService.PopulateAsync(refereceData, cancellationToken)); _logger.LogDebug($"Funding Service got external data: {stopWatchSteps.ElapsedMilliseconds}"); await _fundingTaskProvider.ProvideAsync(fundingServiceContext, message, externalDataCache, cancellationToken); _logger.LogDebug($"Completed Funding Service for given rule bases in: {stopWatch.ElapsedMilliseconds}"); }
public async Task PopulateAsync(CancellationToken cancellationToken) { await Task.WhenAll( _internalDataCachePopulationService.PopulateAsync(cancellationToken), _referenceDataCachePopulationService.PopulateAsync(cancellationToken), _fundingContextPopulationService.PopulateAsync(cancellationToken), _fileDataCachePopulationService.PopulateAsync(cancellationToken)) .ConfigureAwait(false); }
public async Task PopulateAsync(CancellationToken cancellationToken) { await _messageCachePopulationService.PopulateAsync(cancellationToken); await Task.WhenAll( _fileDataCachePopulationService.PopulateAsync(cancellationToken), _internalDataCachePopulationService.PopulateAsync(cancellationToken), _externalDataCachePopulationService.PopulateAsync(cancellationToken)); }