Ejemplo n.º 1
0
        public void Subscribe(ICompletableObserver observer)
        {
            var parent = new CompletableFlatMapSingleObserver <T>(observer, mapper);

            observer.OnSubscribe(parent);

            source.Subscribe(parent);
        }
        internal bool SubscribeTo(ISingleSource <T> source)
        {
            var inner = new InnerObserver(this);

            if (Add(inner))
            {
                source.Subscribe(inner);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
        internal void Next()
        {
            if (Interlocked.Increment(ref wip) == 1)
            {
                for (; ;)
                {
                    if (!DisposableHelper.IsDisposed(ref upstream))
                    {
                        source.Subscribe(this);
                    }

                    if (Interlocked.Decrement(ref wip) == 0)
                    {
                        break;
                    }
                }
            }
        }
        public bool SubscribeTo(ISingleSource <T> source)
        {
            var inner = new InnerObserver(this);

            observers.Enqueue(inner);
            if (Volatile.Read(ref disposed))
            {
                DisposableHelper.WeakDispose(ref inner.upstream);
                Cleanup();
                return(false);
            }
            if (source == null)
            {
                InnerError(inner, new NullReferenceException("The ISingleSource is null"));
                return(true);
            }
            source.Subscribe(inner);
            return(true);
        }
Ejemplo n.º 5
0
 public void Subscribe(IMaybeObserver <T> observer)
 {
     source.Subscribe(new FilterObserver <T>(observer, predicate));
 }
Ejemplo n.º 6
0
 public void Subscribe(ICompletableObserver observer)
 {
     source.Subscribe(new IgnoreMultiObserver <T>(observer));
 }