@Override public final void clear() { STATE.lazySet(this, FUSED_CONSUMED); this.value = null; }
WindowOverlapSubscriber(CoreSubscriber<? super Flux<T>> actual, int size, int skip, Supplier<? extends Queue<T>> processorQueueSupplier, Queue<UnicastProcessor<T>> overflowQueue) { this.actual = actual; this.size = size; this.skip = skip; this.processorQueueSupplier = processorQueueSupplier; WINDOW_COUNT.lazySet(this, 1); this.queue = overflowQueue; }
@Override public int requestFusion(int mode) { if ((mode & ASYNC) != 0) { STATE.lazySet(this, FUSED_EMPTY); return ASYNC; } return NONE; }
WindowExactSubscriber(CoreSubscriber<? super Flux<T>> actual, int size, Supplier<? extends Queue<T>> processorQueueSupplier) { this.actual = actual; this.size = size; this.processorQueueSupplier = processorQueueSupplier; WINDOW_COUNT.lazySet(this, 1); }
private void exclusiveIncrementSize(int amount) { SIZE_UPDATER.lazySet(this, this.size + amount); }
GroupByMain(CoreSubscriber<? super GroupedFlux<K, V>> actual, Queue<GroupedFlux<K, V>> queue, Supplier<? extends Queue<V>> groupQueueSupplier, int prefetch, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector) { this.actual = actual; this.queue = queue; this.groupQueueSupplier = groupQueueSupplier; this.prefetch = prefetch; this.groupMap = new ConcurrentHashMap<>(); this.keySelector = keySelector; this.valueSelector = valueSelector; GROUP_COUNT.lazySet(this, 1); }
FluxAutoConnectFuseable(ConnectableFlux<? extends T> source, int n, Consumer<? super Disposable> cancelSupport) { if (n <= 0) { throw new IllegalArgumentException("n > required but it was " + n); } this.source = Objects.requireNonNull(source, "source"); this.cancelSupport = Objects.requireNonNull(cancelSupport, "cancelSupport"); REMAINING.lazySet(this, n); }
FluxAutoConnect(ConnectableFlux<? extends T> source, int n, Consumer<? super Disposable> cancelSupport) { if (n <= 0) { throw new IllegalArgumentException("n > required but it was " + n); } this.source = Objects.requireNonNull(source, "source"); this.cancelSupport = Objects.requireNonNull(cancelSupport, "cancelSupport"); REMAINING.lazySet(this, n); }
@Override @Nullable public T poll() { if (once == 0) { ONCE.lazySet(this, 1); return value; } return null; }
WindowSkipSubscriber(CoreSubscriber<? super Flux<T>> actual, int size, int skip, Supplier<? extends Queue<T>> processorQueueSupplier) { this.actual = actual; this.ctx = actual.currentContext(); this.size = size; this.skip = skip; this.processorQueueSupplier = processorQueueSupplier; WINDOW_COUNT.lazySet(this, 1); }
MergeSequentialMain(CoreSubscriber<? super T> actual, int n, int prefetch, Supplier<Queue<T>> queueSupplier) { this.actual = actual; this.queueSupplier = queueSupplier; @SuppressWarnings("unchecked") MergeSequentialInner<T>[] a = new MergeSequentialInner[n]; for (int i = 0; i < n; i++) { a[i] = new MergeSequentialInner<>(this, prefetch); } this.subscribers = a; DONE.lazySet(this, n); }
MergeReduceMain(CoreSubscriber<? super T> subscriber, int n, BiFunction<T, T, T> reducer) { super(subscriber); @SuppressWarnings("unchecked") MergeReduceInner<T>[] a = new MergeReduceInner[n]; for (int i = 0; i < n; i++) { a[i] = new MergeReduceInner<>(this, reducer); } this.subscribers = a; this.reducer = reducer; REMAINING.lazySet(this, n); }
@Override @Nullable public final O poll() { if (STATE.get(this) == FUSED_READY) { STATE.lazySet(this, FUSED_CONSUMED); O v = value; value = null; return v; } return null; }
@Override public void cancel() { ONCE.lazySet(this, 1); Disposable f = future; if (f != OperatorDisposables.DISPOSED && future != FINISHED) { f = FUTURE.getAndSet(this, OperatorDisposables.DISPOSED); if (f != null && f != OperatorDisposables.DISPOSED && f != FINISHED) { f.dispose(); } } }
@Override public void cancel() { if (once == 0) { Operators.onDiscard(value, actual.currentContext()); } ONCE.lazySet(this, 2); }
@Override public void clear() { if (once == 0) { Operators.onDiscard(value, actual.currentContext()); } ONCE.lazySet(this, 1); }
void setupSubscribers() { int m = subscribers.length; for (int i = 0; i < m; i++) { if (cancelled) { return; } int j = i; SUBSCRIBER_COUNT.lazySet(this, i + 1); subscribers[i].onSubscribe(new ParallelSourceInner<>(this, j, m)); } }
final void remove(int index) { synchronized (this) { T[] a = array; if (a != terminated()) { a[index] = null; offerFree(index); SIZE.lazySet(this, size - 1); } } }
void subscribe(int n, int sc, Publisher<? extends T>[] sources) { WIP.lazySet(this, n - sc); ZipSingleSubscriber<T>[] a = subscribers; for (int i = 0; i < n; i++) { if (wip <= 0 || isCancelled()) { break; } ZipSingleSubscriber<T> s = a[i]; if (s != null) { sources[i].subscribe(s); } } }
WindowBoundaryMain(CoreSubscriber<? super Flux<T>> actual, Supplier<? extends Queue<T>> processorQueueSupplier, Queue<T> processorQueue) { this.actual = actual; this.processorQueueSupplier = processorQueueSupplier; this.window = new UnicastProcessor<>(processorQueue, this); WINDOW_COUNT.lazySet(this, 2); this.boundary = new WindowBoundaryOther<>(this); this.queue = Queues.unboundedMultiproducer().get(); }