@Override public FluxSink<T> next(T t) { Objects.requireNonNull(t, "t is null in sink.next(t)"); if (sink.isCancelled() || done) { Operators.onNextDropped(t, sink.currentContext()); return this; } if (WIP.get(this) == 0 && WIP.compareAndSet(this, 0, 1)) { try { sink.next(t); } catch (Throwable ex) { Operators.onOperatorError(sink, ex, t, sink.currentContext()); } if (WIP.decrementAndGet(this) == 0) { return this; } } else { this.mpscQueue.offer(t); if (WIP.getAndIncrement(this) != 0) { return this; } } drainLoop(); return this; }
@Override public void error(Throwable t) { Objects.requireNonNull(t, "t is null in sink.error(t)"); if (sink.isCancelled() || done) { Operators.onOperatorError(t, sink.currentContext()); return; } if (Exceptions.addThrowable(ERROR, this, t)) { done = true; drain(); } else { Operators.onOperatorError(t, sink.currentContext()); } }
onSubscribe(s); if(s.isCancelled() || (isSerialized() && getBufferSize() == Integer.MAX_VALUE)){ return s;
if (e.isCancelled()) { Operators.onDiscardQueueWithClear(q, ctx, null); return;
onSubscribe(s); if(s.isCancelled() || (isSerialized() && getBufferSize() == Integer.MAX_VALUE)){ return s;
@Override public FluxSink<T> next(T t) { Objects.requireNonNull(t, "t is null in sink.next(t)"); if (sink.isCancelled() || done) { Operators.onNextDropped(t, sink.currentContext()); return this; } if (WIP.get(this) == 0 && WIP.compareAndSet(this, 0, 1)) { try { sink.next(t); } catch (Throwable ex) { Operators.onOperatorError(sink, ex, t, sink.currentContext()); } if (WIP.decrementAndGet(this) == 0) { return this; } } else { this.mpscQueue.offer(t); if (WIP.getAndIncrement(this) != 0) { return this; } } drainLoop(); return this; }
@Override public void error(Throwable t) { Objects.requireNonNull(t, "t is null in sink.error(t)"); if (sink.isCancelled() || done) { Operators.onOperatorError(t, sink.currentContext()); return; } if (Exceptions.addThrowable(ERROR, this, t)) { done = true; drain(); } else { Operators.onOperatorError(t, sink.currentContext()); } }
@Override public void error(Throwable e) { if (isCancelled()) { Operators.onOperatorError(e, ctx); return; } try { actual.onError(e); } finally { disposeResource(false); } }
@Override public boolean isCancelled() { return sink.isCancelled(); }
@Override public void complete() { if (sink.isCancelled() || done) { return; } done = true; drain(); }
@Override public final void request(long n) { if (Operators.validate(n)) { Operators.addCap(REQUESTED, this, n); LongConsumer consumer = requestConsumer; if (n > 0 && consumer != null && !isCancelled()) { consumer.accept(n); } onRequestedFromDownstream(); } }
@Override public void complete() { if (isCancelled()) { return; } try { actual.onComplete(); } finally { disposeResource(false); } }
if (e.isCancelled()) { Operators.onDiscardQueueWithClear(q, ctx, null); return;
@Override public void error(Throwable e) { if (isCancelled()) { Operators.onOperatorError(e, ctx); return; } try { actual.onError(e); } finally { disposeResource(false); } }
@Override public void complete() { if (isCancelled()) { return; } try { actual.onComplete(); } finally { disposeResource(false); } }
@Override public boolean isCancelled() { return sink.isCancelled(); }
@Override public final void request(long n) { if (Operators.validate(n)) { Operators.addCap(REQUESTED, this, n); LongConsumer consumer = requestConsumer; if (n > 0 && consumer != null && !isCancelled()) { consumer.accept(n); } onRequestedFromDownstream(); } }
@Override public void complete() { if (sink.isCancelled() || done) { return; } done = true; drain(); }