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); }
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); }
public void Subscribe(IMaybeObserver <T> observer) { source.Subscribe(new FilterObserver <T>(observer, predicate)); }
public void Subscribe(ICompletableObserver observer) { source.Subscribe(new IgnoreMultiObserver <T>(observer)); }