Esempio n. 1
0
        public async Task RequestStaticAnalytics()
        {
            var request = new AnalyticsRequestToModel {
                Message = "sample message"
            };
            var config = _rabbitMqConfiguration.StaticInfoRpcConfiguration;

            _messagingService.ResponseProcessor = ProcessModelResponse;
            await _messagingService.SendAsync(config, request);
        }
        public async Task <RevenueForecasts> StartCalculationAsync(FullUserInfo fullUserInfo)
        {
            var existingForecast = await _cachingService.GetRevenueForecastAsync(fullUserInfo);

            if (existingForecast != null)
            {
                return(existingForecast);
            }
            var draftForecast = await _databaseAccessService.CreateForecastAsync(fullUserInfo.ForecastType);

            var messageToModel = PrepareMessageToModel(fullUserInfo, draftForecast);

            _modelMessagingService.ResponseProcessor = ModelResponseProcessor;
            var rpcParams = _rabbitMqConfiguration.ForecastRpcConfiguration;
            await _modelMessagingService.SendAsync(rpcParams, messageToModel);

            return(draftForecast);
        }