Пример #1
0
        public Task Handle(AddMorseChar message, IMessageHandlerContext context)
        {
            if (Data.MorseList == null)
            {
                Data.MorseList = new List <string>();
            }

            Data.MorseList.Add(message.Morse);

            if (Data.OrigMessageText.Length == Data.MorseList.Count)
            {
                context.SendLocal(new SendConvertedMessage {
                    MessageId = message.MessageId, Message = MorseConverter.FromMorse(Data.MorseList.ToArray())
                });
                DrawStartup.Message(Data.MorseList.ToArray());
            }



            return(Task.FromResult(0));
        }
Пример #2
0
        public static void Main(string[] args)
        {
            var busConfiguration = new BusConfiguration();

            busConfiguration.EndpointName("Anything");
            //            busConfiguration.UseTransport<Git>().ConnectionString("bla");
            busConfiguration.UseSerialization <JsonSerializer>();
            busConfiguration.EnableInstallers();
            busConfiguration.UsePersistence <InMemoryPersistence>();
            busConfiguration.LimitMessageProcessingConcurrencyTo(1);
            busConfiguration.SendFailedMessagesTo("error");

            var endpoint = Endpoint.Start(busConfiguration).GetAwaiter().GetResult();
            var context  = endpoint.CreateBusContext();

            Console.ReadLine();
            DrawStartup.IvoryXylophone();

            //Thread.Sleep(100);
            //context.SendLocal(new StartSaga { MessageId = Guid.NewGuid(), Text = "Da BAD ASS TEst" });

            Console.ReadLine();
        }