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); } }
// 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(); } } }
public CommandProcessor(ThreadedMessageEventDispatcher<QueueMessage> microservices) { this.microservices = microservices; microservices.MessageReceived += OnMessageReceived; }