reactor-core/src/main/java/reactor/core/publisher/EventLoopProcessor.java
static boolean waitRequestOrTerminalEvent(LongSupplier pendingRequest,
			RingBuffer.Reader barrier,
			AtomicBoolean isRunning,
			LongSupplier nextSequence,
			Runnable waiter) {
		try {
			long waitedSequence;
			while (pendingRequest.getAsLong() <= 0L) {
				//pause until first request
				waitedSequence = nextSequence.getAsLong() + 1;
				waiter.run();
				barrier.waitFor(waitedSequence, waiter);

				if (!isRunning.get()) {
					WaitStrategy.alert();
				}
				LockSupport.parkNanos(1L);
			}
		}
		catch (InterruptedException ie) {
			Thread.currentThread()
			      .interrupt();
		}

		catch (Exception e) {
			if (!isRunning.get() || WaitStrategy.isAlert(e)) {
				return false;
			}
			throw e;
		}

		return true;
	}
static boolean waitRequestOrTerminalEvent(LongSupplier pendingRequest,
			RingBuffer.Reader barrier,
			AtomicBoolean isRunning,
			LongSupplier nextSequence,
			Runnable waiter) {
		try {
			long waitedSequence;
			while (pendingRequest.getAsLong() <= 0L) {
				//pause until first request
				waitedSequence = nextSequence.getAsLong() + 1;
				waiter.run();
				barrier.waitFor(waitedSequence, waiter);

				if (!isRunning.get()) {
					WaitStrategy.alert();
				}
				LockSupport.parkNanos(1L);
			}
		}
		catch (InterruptedException ie) {
			Thread.currentThread()
			      .interrupt();
		}

		catch (Exception e) {
			if (!isRunning.get() || WaitStrategy.isAlert(e)) {
				return false;
			}
			throw e;
		}

		return true;
	}
static boolean waitRequestOrTerminalEvent ( LongSupplier pendingRequest , RingBuffer . Reader barrier , AtomicBoolean isRunning , LongSupplier nextSequence , Runnable waiter ) { try { long waitedSequence ; while ( pendingRequest . getAsLong ( ) <= 0L ) { //pause until first request waitedSequence = nextSequence . getAsLong ( ) + 1 ; waiter . run ( ) ; barrier . waitFor ( waitedSequence , waiter ) ; if ( ! isRunning . get ( ) ) { WaitStrategy . alert ( ) ; } LockSupport . parkNanos ( 1L ) ; } } catch ( InterruptedException ie ) { Thread . currentThread ( ) . interrupt ( ) ; } catch ( Exception e ) { if ( ! isRunning . get ( ) || WaitStrategy . isAlert ( e ) ) { return false ; } throw e ; } return true ; }
Spin CPU until the request {@link LongSupplier} is populated at least once by a
strict positive value. To relieve the spin loop, the read sequence itself will be
used against so it will wake up only when a signal is emitted upstream or other
stopping condition including terminal signals thrown by the {@link
RingBuffer.Reader} waiting barrier.

@param pendingRequest the {@link LongSupplier} request to observe
@param barrier {@link RingBuffer.Reader} to wait on
@param isRunning {@link AtomicBoolean} calling loop running state
@param nextSequence {@link LongSupplier} ring buffer read cursor
@param waiter an optional extra spin observer for the wait strategy in {@link
RingBuffer.Reader}

@return true if a request has been received, false in any other case.
Spin CPU until the request { @link LongSupplier } is populated at least once by a strict positive value . To relieve the spin loop the read sequence itself will be used against so it will wake up only when a signal is emitted upstream or other stopping condition including terminal signals thrown by the { @link RingBuffer . Reader } waiting barrier .