@Override protected void doError(Throwable t) { writeWait.signalAllWhenBlocking(); //ringBuffer.markAsTerminated(); }
@Override protected void doComplete() { writeWait.signalAllWhenBlocking(); //ringBuffer.markAsTerminated(); }
/** * Alert the ringbuffer consumers of a status change and stay in this status until cleared. */ void alert() { alerted = true; waitStrategy.signalAllWhenBlocking(); }
/** * Signal the ringbuffer consumers. */ void signal() { waitStrategy.signalAllWhenBlocking(); }
@Override public void signalAllWhenBlocking() { fallbackStrategy.signalAllWhenBlocking(); }
final void cancel() { cancelled = true; if (TERMINATED.compareAndSet(this, 0, SHUTDOWN)) { executor.shutdown(); } readWait.signalAllWhenBlocking(); }
/** * See {@code RingBufferProducer.publish(long)}. */ @Override void publish(final long sequence) { setAvailable(sequence); waitStrategy.signalAllWhenBlocking(); }
/** * See {@code RingBufferProducer.publish(long)}. */ @Override void publish(long sequence) { cursor.set(sequence); waitStrategy.signalAllWhenBlocking(); }
@Override final public void onComplete() { if (TERMINATED.compareAndSet(this, 0, SHUTDOWN)) { upstreamSubscription = null; doComplete(); executor.shutdown(); readWait.signalAllWhenBlocking(); } }
boolean reschedule(@Nullable Slot<T> event) { if (event != null && event.value != null) { processor.claimedDisposed.add(event.value); barrier.alert(); processor.readWait.signalAllWhenBlocking(); return true; } return false; }
@Override final public void onError(Throwable t) { Objects.requireNonNull(t, "onError"); if (TERMINATED.compareAndSet(this, 0, SHUTDOWN)) { error = t; upstreamSubscription = null; doError(t); executor.shutdown(); readWait.signalAllWhenBlocking(); } else { Operators.onErrorDropped(t, Context.empty()); } }
processor.readWait.signalAllWhenBlocking(); return true; processor.readWait.signalAllWhenBlocking(); return !processor.alive() && processor.ringBuffer.getPending() == 0; long cursor = s.getAsLong() + 1L; if(cursor > processor.ringBuffer.getAsLong()){ processor.readWait.signalAllWhenBlocking(); return !processor.alive() && processor.ringBuffer.getPending() == 0;
@Override @SuppressWarnings("unchecked") public final void onError(Throwable cause) { Objects.requireNonNull(cause, "onError cannot be null"); if (UPSTREAM.getAndSet(this, Operators.cancelledSubscription()) == Operators.cancelledSubscription()) { Operators.onErrorDroppedMulticast(cause); return; } error = cause; value = null; source = null; for (NextInner<O> as : SUBSCRIBERS.getAndSet(this, TERMINATED)) { as.onError(cause); } waitStrategy.signalAllWhenBlocking(); }
@Override @SuppressWarnings("unchecked") public void dispose() { Subscription s = UPSTREAM.getAndSet(this, Operators.cancelledSubscription()); if (s == Operators.cancelledSubscription()) { return; } source = null; if (s != null) { s.cancel(); } NextInner<O>[] a; if ((a = SUBSCRIBERS.getAndSet(this, TERMINATED)) != TERMINATED) { Exception e = new CancellationException("Disposed"); error = e; value = null; for (NextInner<O> as : a) { as.onError(e); } } waitStrategy.signalAllWhenBlocking(); }
processor.readWait.signalAllWhenBlocking(); processor.decrementSubscribers(); running.set(false); processor.readWait.signalAllWhenBlocking();
processor.readWait.signalAllWhenBlocking(); cachedAvailableSequence = barrier.waitFor(nextSequence, waiter); processor.writeWait.signalAllWhenBlocking();
@Override @SuppressWarnings("unchecked") public final void onNext(@Nullable O value) { Subscription s; if ((s = UPSTREAM.getAndSet(this, Operators.cancelledSubscription())) == Operators.cancelledSubscription()) { if (value != null) { Operators.onNextDroppedMulticast(value); } return; } this.value = value; Publisher<? extends O> parent = source; source = null; NextInner<O>[] array = SUBSCRIBERS.getAndSet(this, TERMINATED); if (value == null) { for (NextInner<O> as : array) { as.onComplete(); } } else { if (s != null && !(parent instanceof Mono)) { s.cancel(); } for (NextInner<O> as : array) { as.complete(value); } } waitStrategy.signalAllWhenBlocking(); }
@Override protected void doError(Throwable t) { writeWait.signalAllWhenBlocking(); //ringBuffer.markAsTerminated(); }
/** * See {@code RingBufferProducer.publish(long)}. */ @Override void publish(long sequence) { cursor.set(sequence); waitStrategy.signalAllWhenBlocking(); }
/** * See {@code RingBufferProducer.publish(long)}. */ @Override void publish(final long sequence) { setAvailable(sequence); waitStrategy.signalAllWhenBlocking(); }