コード例 #1
0
ファイル: Program.cs プロジェクト: stimpy77/chorea
 static void Main(string[] args)
 {
     using (var messageEventDispatcher = new ThreadedMessageEventDispatcher<QueueMessage>())
     {
         var commandInputLoop = new ConsoleCommandInputService();
         messageEventDispatcher.RegisterMessageSource(commandInputLoop);
         var commandProcessor = new CommandProcessor(messageEventDispatcher);
         messageEventDispatcher.Start();
         while (messageEventDispatcher.IsRunning) Thread.Sleep(100);
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: stimpy77/chorea
        // ReSharper disable once UnusedParameter.Local
        static void Main(string[] args)
        {
            var messageSystem =
            //new BasicMessageQueueContainer<BrokenRecordRequest>("Marco");
            new LocalMessagePublishContainer<BrokenRecordRequest>("Marco");
            using (var requester = new BrokenRecordRequester(messageSystem))
            {
                using (var dispatcher = new ThreadedMessageEventDispatcher<BrokenRecordRequest>("Marco"))
                {
                    dispatcher.RegisterMessageSource(messageSystem);
                    var responder = new BrokenRecordResponder(dispatcher);
                    dispatcher.Start();

                    requester.Start();

                    Console.WriteLine("Press ENTER to exit ...");
                    Console.ReadLine();
                }

            }
        }
コード例 #3
0
ファイル: CommandProcessor.cs プロジェクト: stimpy77/chorea
 public CommandProcessor(ThreadedMessageEventDispatcher<QueueMessage> microservices)
 {
     this.microservices = microservices;
     microservices.MessageReceived += OnMessageReceived;
 }