public void Register(IAppHost appHost) { var broker = new MemoryServerEventsBroker() { //Timeout = Timeout, }; var container = appHost.GetContainer(); if (container.TryResolve <IServerEventsBroker>() == null) { container.Register <IServerEventsBroker>(broker); } appHost.RawHttpHandlers.Add(httpReq => httpReq.PathInfo.EndsWith(StreamPath) ? (IHttpHandler) new ServerEventsHandler() //: httpReq.PathInfo.EndsWith(HeartbeatPath) // ? new ServerEventsHeartbeatHandler() : null); }
public void Register(IAppHost appHost) { var broker = new MemoryServerEventsBroker() { //Timeout = Timeout, }; var container = appHost.GetContainer(); if (container.TryResolve<IServerEventsBroker>() == null) container.Register<IServerEventsBroker>(broker); appHost.RawHttpHandlers.Add(httpReq => httpReq.PathInfo.EndsWith(StreamPath) ? (IHttpHandler)new ServerEventsHandler() //: httpReq.PathInfo.EndsWith(HeartbeatPath) // ? new ServerEventsHeartbeatHandler() : null); }