Exemple #1
0
        public void Startup(IServiceCollection services)
        {
            this.messageHandlerContainer = new MessageHandlerContainer();

            this.messageHandlerProducer = new MessageHandlerProducer(
                new MessageQueueFactory(
                    this.MessageFactory,
                    new QueueWebSocketSubscriberFactory(WebSubscriberSettings.Default)),
                new MessageApplicationFactory(
                    this.MessageFactory,
                    new ApplicationWebSocketSubscriberFactory(WebSubscriberSettings.Default)),
                new MessageBusFactory());

            this.healthChecker.Start();

            this.Router = new Router(this.messageHandlerContainer, this.messageHandlerProducer, new WebSocketConnector(this.healthChecker));

            services.AddSingleton <IMessageHandlerContainer>(this.messageHandlerContainer);
            services.AddSingleton <IMessageHandlerProducer>(this.messageHandlerProducer);
        }
Exemple #2
0
 public Router(IMessageHandlerContainer messageHandlerContainer, IMessageHandlerProducer messageHandlerProducer, IWebSocketConnector webSocketConnector)
 {
     this.messageHandlerContainer = messageHandlerContainer;
     this.messageHandlerProducer  = messageHandlerProducer;
     this.webSocketConnector      = webSocketConnector;
 }