Ejemplo n.º 1
0
        public Task ConnectAsync()
        {
            ConnectingSubject.OnNext(Unit.Default);

            return(_listenerEvents.SelectMany(list => list)
                   .Concat(Observable.Defer(() => ReactiveLoggerService.ListenerEvents))
                   .TakeUntil(DisconnectingSubject)
                   .Select(e => {
                var message = (TraceEventMessage)e;
                Broadcast(_group).OnTraceEvent(message);
                BroadcastedSubject.OnNext(message);
                return Unit.Default;
            })
                   .DoNotComplete()
                   .ToTask());
        }