Beispiel #1
0
        public async Task Recieve(CalculationRequest request)
        {
            var value = this.previous + request.Value;

            this.previous = value;
            await this.apiAgent.Send(new CalculationRequest(request.CorrelationId, value));
        }
Beispiel #2
0
        public async Task Receive(CalculationRequest calculationRequest)
        {
            var calculator = this.dictionary.GetOrAdd(calculationRequest.CorrelationId, _ => this.calculatorFactory());

            this.log.Info($"Calculating next value for {calculationRequest.Value}");
            await calculator.Recieve(calculationRequest);
        }