internal static FlowablePeek <T> Create(IFlowable <T> source, Action <T> onNext = null, Action <T> onAfterNext = null, Action <Exception> onError = null, Action onComplete = null, Action onTerminated = null, Action onAfterTerminated = null, Action <ISubscription> onSubscribe = null, Action <long> onRequest = null, Action onCancel = null) { if (source is FlowablePeek <T> s) { source = s.source; onNext = Combine(s.onNext, onNext); onAfterNext = Combine(s.onAfterNext, onAfterNext); onError = Combine(s.onError, onError); onComplete = Combine(s.onComplete, onComplete); onTerminated = Combine(s.onTerminated, onTerminated); onAfterTerminated = Combine(s.onAfterTerminated, onAfterTerminated); onSubscribe = Combine(s.onSubscribe, onSubscribe); onRequest = Combine(s.onRequest, onRequest); onCancel = Combine(s.onCancel, onCancel); } return(new FlowablePeek <T>(source, onNext, onAfterNext, onError, onComplete, onTerminated, onAfterTerminated, onSubscribe, onRequest, onCancel)); }
public FlowableTimeout(IFlowable <T> source, TimeSpan firstTimeout, TimeSpan itemTimeout, IExecutorService executor, IPublisher <T> fallback) : base(source) { this.firstTimeout = firstTimeout; this.itemTimeout = itemTimeout; this.executor = executor; this.fallback = fallback; }
internal RepeatWhenSubscriber(IFlowableSubscriber <T> actual, IFlowableProcessor <object> signaller, IFlowable <T> source) { this.actual = actual; this.signaller = signaller; this.source = source; this.handler = new HandlerSubscriber(this); }
internal RetryWhenSubscriber(IFlowableSubscriber <T> actual, IFlowableProcessor <Exception> signaller, IFlowable <T> source) { this.actual = actual; this.signaller = signaller; this.source = source; this.handler = new HandlerSubscriber(this); }
internal void Run() { var f = source; source = null; f.Subscribe(this); }
internal RepeatSubscriber(IFlowableSubscriber <T> actual, Func <bool> stop, long times, IFlowable <T> source) { this.actual = actual; this.stop = stop; this.remaining = times; this.source = source; }
internal SubscribeOnSubscriber(IFlowableSubscriber <T> actual, IExecutorWorker worker, bool requestOn, IFlowable <T> source) { this.actual = actual; this.worker = worker; this.source = source; this.requestOn = requestOn; }
internal RetrySubscriber(IFlowableSubscriber <T> actual, Func <Exception, bool> handler, long times, IFlowable <T> source) { this.actual = actual; this.handler = handler; this.remaining = times; this.source = source; }
public FlowableConcatMapEager(IFlowable <T> source, Func <T, IPublisher <R> > mapper, int maxConcurrency, int prefetch) : base(source) { this.mapper = mapper; this.maxConcurrency = maxConcurrency; this.prefetch = prefetch; }
public static IFlowable <TSource> Delay <TSource>(this IFlowable <TSource> inflow, int miliseconds) { return(new FlowableWithUpstream <TSource, TSource>(inflow, (x, s) => { Thread.Sleep(miliseconds); s.OnNext(x); })); }
public static IFlowable <TSource> Delay <TSource>(this IFlowable <TSource> inflow, TimeSpan delay) { return(new FlowableWithUpstream <TSource, TSource>(inflow, (x, s) => { Thread.Sleep(delay); s.OnNext(x); })); }
public FlowableWithUpstream(IFlowable <T> upstream, Action <T, ISubscriber <R> > onNextFilter, Action <int, ISubscription> onRequestFilter = null) { this.upstream = upstream; this.onNextFilter = onNextFilter; this.onRequestFilter = onRequestFilter ?? ((n, s) => { s.Request(n); }); }
public FlowableFlatMap(IFlowable <T> source, Func <T, IPublisher <R> > mapper, int maxConcurrency, int bufferSize) : base(source) { this.mapper = mapper; this.maxConcurrency = maxConcurrency; this.bufferSize = bufferSize; }
public static IFlowable <T> Merge <T>(this IFlowable <T> first, IEnumerable <IFlowable <T> > rest) { var lst = new List <IFlowable <T> >() { first }; lst.AddRange(rest); return(new FlowableMerge <T>(lst)); }
public static IFlowable <TSource> Where <TSource>(this IFlowable <TSource> inflow, Func <TSource, bool> filter) { return(new FlowableWithUpstream <TSource, TSource>(inflow, (x, s) => { if (filter(x)) { s.OnNext(x); } })); }
public bool Poll(out IFlowable <T> item) { if (windows.Poll(out var v)) { item = v; return(true); } item = default(IFlowable <T>); return(false); }
public static IFlowable <T> Merge <T>(this IFlowable <T> first, params IFlowable <T>[] list) { var lst = new List <IFlowable <T> >() { first }; lst.AddRange(list); return(new FlowableMerge <T>(lst)); }
internal void Subscribe(IFlowable <T> source) { if (Interlocked.Increment(ref wip) == 1) { do { if (ArbiterIsCancelled()) { return; } if (source == null) { var fs = fallbacks; bool b; try { b = fs.MoveNext(); } catch (Exception ex) { fs.Dispose(); actual.OnError(ex); return; } if (!b) { actual.OnComplete(); return; } else { fs.Current.Subscribe(this); } } else { source.Subscribe(this); source = null; } }while (Interlocked.Decrement(ref wip) != 0); } }
internal void Subscribe(IFlowable <T> source) { if (Interlocked.Increment(ref wip) == 1) { do { if (source == null) { hasValue = true; fallback.Subscribe(this); } else { source.Subscribe(this); source = null; } }while (Interlocked.Decrement(ref wip) != 0); } }
FlowablePeek(IFlowable <T> source, Action <T> onNext = null, Action <T> onAfterNext = null, Action <Exception> onError = null, Action onComplete = null, Action onTerminated = null, Action onAfterTerminated = null, Action <ISubscription> onSubscribe = null, Action <long> onRequest = null, Action onCancel = null) : base(source) { this.onNext = onNext; this.onAfterNext = onAfterNext; this.onError = onError; this.onComplete = onComplete; this.onTerminated = onTerminated; this.onAfterTerminated = onAfterTerminated; this.onSubscribe = onSubscribe; this.onRequest = onRequest; this.onCancel = onCancel; }
internal void Subscribe(IFlowable <T> source) { if (Interlocked.Increment(ref wip) == 1) { do { if (ArbiterIsCancelled()) { return; } if (source == null) { var fs = fallbacks; var n = fs.Length; var i = index; if (i == n) { actual.OnComplete(); return; } else { index = i + 1; fs[i].Subscribe(this); } } else { source.Subscribe(this); source = null; } }while (Interlocked.Decrement(ref wip) != 0); } }
public FlowableGroupBy(IFlowable <T> source, Func <T, K> keySelector, Func <T, V> valueSelector, int bufferSize) : base(source) { this.keySelector = keySelector; this.valueSelector = valueSelector; this.bufferSize = bufferSize; }
public FlowableWindowSizeExact(IFlowable <T> source, int size) : base(source) { this.size = size; }
public FlowableBufferSizeExact(IFlowable <T> source, int size, Func <C> collectionSupplier) : base(source) { this.size = size; this.collectionSupplier = collectionSupplier; }
public FlowableSwitchIfEmpty(IFlowable <T> source, IPublisher <T> fallback) : base(source) { this.fallback = fallback; }
public FlowableSubscribeOn(IFlowable <T> source, IExecutorService executor, bool requestOn) : base(source) { this.executor = executor; this.requestOn = requestOn; }
public FlowableTakeLastOne(IFlowable <T> source) : base(source) { }
public bool Poll(out IFlowable <T> item) { return(queue.Poll(out item)); }
public FlowableWindowBoundary(IFlowable <T> source, IPublisher <U> boundary, int bufferSize) : base(source) { this.boundary = boundary; this.bufferSize = bufferSize; }
public ConnectableFlowableMulticast(IFlowable <T> source, Func <IFlowableProcessor <T> > processorSupplier) : base(source) { this.processorSupplier = processorSupplier; this.processor = processorSupplier(); }
public TaskInfo(Identity identity, IFlowable<object> flowable, Identity[] dependencies) { _identity = identity; _flowable = flowable; _dependencies = dependencies; }