Пример #1
0
        private void HandleAddMessage(AddCommandMessage addCommandMessage)
        {
            Console.WriteLine($"Ich berechne die Aufgabe {addCommandMessage.Summand1}+{addCommandMessage.Summand2}");
            var result        = addCommandMessage.Summand1 + addCommandMessage.Summand2;
            var resultMessage = new ResultCalculatedEventMessage(result, addCommandMessage);

            addCommandMessage.ResultReceiver.Tell(resultMessage);
            cacheResultPublisher.Tell(new Publish("resultCache", resultMessage));
        }
        private void HandleGetResultFromCacheAdd(AddCommandMessage addCommand)
        {
            var key = $"add_{addCommand.Summand1}_{addCommand.Summand2}";

            HandleCalculationWithCacheKey(addCommand, key);
        }