Example #1
0
 public ConnectionState(IEventsTransport eventsTransport)
 {
     this.eventsTransport = eventsTransport;
     DocumentStore        = new DocumentsConnectionState(Enqueue);
     FileSystem           = new FileSystemConnectionState(Enqueue);
     CounterStorage       = new CounterStorageConnectionState(Enqueue);
     TimeSeries           = new TimeSeriesConnectionState(Enqueue);
 }
Example #2
0
 public ConnectionState Register(IEventsTransport transport)
 {
     timeSensitiveStore.Seen(transport.Id);
     transport.Disconnected += () => TimeSensitiveStore.Missing(transport.Id);
     return(connections.AddOrUpdate(transport.Id, new ConnectionState(transport), (s, state) =>
     {
         state.Reconnect(transport);
         return state;
     }));
 }
Example #3
0
		public ConnectionState Register(IEventsTransport transport)
		{
			timeSensitiveStore.Seen(transport.Id);
			transport.Disconnected += () => TimeSensitiveStore.Missing(transport.Id);
			return connections.AddOrUpdate(transport.Id, new ConnectionState(transport), (s, state) =>
			                                                                             	{
			                                                                             		state.Reconnect(transport);
			                                                                             		return state;
			                                                                             	});
		}
Example #4
0
        public ConnectionState For(string id, RavenDbApiController controller = null)
        {
            return(connections.GetOrAdd(id, _ =>
            {
                IEventsTransport eventsTransport = null;
                if (controller != null)
                {
                    eventsTransport = new ChangesPushContent(controller);
                }

                var connectionState = new ConnectionState(eventsTransport);
                TimeSensitiveStore.Missing(id);
                return connectionState;
            }));
        }
Example #5
0
        public void RegisterResourceHttpTraceTransport(IEventsTransport transport, string resourceName)
        {
            var curResourceEventTransports = resourceHttpTraces.GetOrAdd(resourceName);

            curResourceEventTransports.Add(transport);
            transport.Disconnected += () =>
            {
                ConcurrentSet <IEventsTransport> resourceEventTransports;
                resourceHttpTraces.TryGetValue(resourceName, out resourceEventTransports);

                if (resourceEventTransports != null)
                {
                    resourceEventTransports.TryRemove(transport);
                }
            };
        }
Example #6
0
 public AdminLogsConnectionState Register(IEventsTransport transport)
 {
     timeSensitiveStore.Seen(transport.Id);
     transport.Disconnected += () =>
     {
         timeSensitiveStore.Missing(transport.Id);
         AdminLogsConnectionState _;
         connections.TryRemove(transport.Id, out _);
         AlterEnabled();
     };
     return(connections.AddOrUpdate(
                transport.Id,
                new AdminLogsConnectionState(transport),
                (s, state) =>
     {
         state.Reconnect(transport);
         return state;
     }));
 }
Example #7
0
 public AdminLogsConnectionState Register(IEventsTransport transport)
 {
     timeSensitiveStore.Seen(transport.Id);
     transport.Disconnected += () =>
     {
         timeSensitiveStore.Missing(transport.Id);
         AdminLogsConnectionState _;
         connections.TryRemove(transport.Id, out _);
         AlterEnabled();
     };
     return connections.AddOrUpdate(
         transport.Id,
         new AdminLogsConnectionState(transport),
         (s, state) =>
         {
             state.Reconnect(transport);
             return state;
         });
 }
Example #8
0
        public AdminLogsConnectionState For(string id, RavenBaseApiController controller = null)
        {
            var connection = connections.GetOrAdd(
                id,
                _ =>
            {
                IEventsTransport logsTransport = null;
                if (controller != null)
                {
                    logsTransport = new LogsPushContent(controller);
                }

                var connectionState = new AdminLogsConnectionState(logsTransport);
                TimeSensitiveStore.Missing(id);
                return(connectionState);
            });

            AlterEnabled();
            return(connection);
        }
		public void RegisterResourceHttpTraceTransport(IEventsTransport transport, string resourceName)
		{
			var curResourceEventTransports = resourceHttpTraces.GetOrAdd(resourceName);
			curResourceEventTransports.Add(transport);
			transport.Disconnected += () =>
			{
				ConcurrentSet<IEventsTransport> resourceEventTransports;
				resourceHttpTraces.TryGetValue(resourceName, out resourceEventTransports);

				if (resourceEventTransports != null)
					resourceEventTransports.TryRemove(transport);
			};
		}
Example #10
0
		public void RegisterServerHttpTraceTransport(IEventsTransport transport)
		{
			serverHttpTrace.Add(transport);
			transport.Disconnected += () => serverHttpTrace.TryRemove(transport);
		}
Example #11
0
 public void RegisterServerHttpTraceTransport(IEventsTransport transport)
 {
     serverHttpTrace.Add(transport);
     transport.Disconnected += () => serverHttpTrace.TryRemove(transport);
 }
Example #12
0
 public void Reconnect(IEventsTransport transport)
 {
     eventsTransport = transport;
 }
Example #13
0
		public ConnectionState(IEventsTransport eventsTransport)
		{
			this.eventsTransport = eventsTransport;
		}
Example #14
0
		public void Reconnect(IEventsTransport transport)
		{
			eventsTransport = transport;
		}
 public AdminLogsConnectionState(IEventsTransport logsTransport)
 {
     this.logsTransport = logsTransport;
 }
Example #16
0
 public ConnectionState(IEventsTransport eventsTransport)
 {
     this.eventsTransport = eventsTransport;
 }