reactor-core/src/main/java/reactor/util/concurrent/MpscLinkedQueue.java
@Nullable
	@Override
	public E poll() {
		LinkedQueueNode<E> currConsumerNode = consumerNode; // don't load twice, it's alright
		LinkedQueueNode<E> nextNode = currConsumerNode.lvNext();

		if (nextNode != null)
		{
			// we have to null out the value because we are going to hang on to the node
			final E nextValue = nextNode.getAndNullValue();

			// Fix up the next ref of currConsumerNode to prevent promoted nodes from keeping new ones alive.
			// We use a reference to self instead of null because null is already a meaningful value (the next of
			// producer node is null).
			currConsumerNode.soNext(currConsumerNode);
			CONSUMER_NODE_UPDATER.lazySet(this, nextNode);
			// currConsumerNode is now no longer referenced and can be collected
			return nextValue;
		}
		else if (currConsumerNode != producerNode)
		{
			while ((nextNode = currConsumerNode.lvNext()) == null) { }
			// got the next node...
			// we have to null out the value because we are going to hang on to the node
			final E nextValue = nextNode.getAndNullValue();

			// Fix up the next ref of currConsumerNode to prevent promoted nodes from keeping new ones alive.
			// We use a reference to self instead of null because null is already a meaningful value (the next of
			// producer node is null).
			currConsumerNode.soNext(currConsumerNode);
			CONSUMER_NODE_UPDATER.lazySet(this, nextNode);
			// currConsumerNode is now no longer referenced and can be collected
			return nextValue;
		}
		return null;
	}
@Nullable
	@Override
	public E poll() {
		LinkedQueueNode<E> currConsumerNode = consumerNode; // don't load twice, it's alright
		LinkedQueueNode<E> nextNode = currConsumerNode.lvNext();

		if (nextNode != null)
		{
			// we have to null out the value because we are going to hang on to the node
			final E nextValue = nextNode.getAndNullValue();

			// Fix up the next ref of currConsumerNode to prevent promoted nodes from keeping new ones alive.
			// We use a reference to self instead of null because null is already a meaningful value (the next of
			// producer node is null).
			currConsumerNode.soNext(currConsumerNode);
			CONSUMER_NODE_UPDATER.lazySet(this, nextNode);
			// currConsumerNode is now no longer referenced and can be collected
			return nextValue;
		}
		else if (currConsumerNode != producerNode)
		{
			while ((nextNode = currConsumerNode.lvNext()) == null) { }
			// got the next node...
			// we have to null out the value because we are going to hang on to the node
			final E nextValue = nextNode.getAndNullValue();

			// Fix up the next ref of currConsumerNode to prevent promoted nodes from keeping new ones alive.
			// We use a reference to self instead of null because null is already a meaningful value (the next of
			// producer node is null).
			currConsumerNode.soNext(currConsumerNode);
			CONSUMER_NODE_UPDATER.lazySet(this, nextNode);
			// currConsumerNode is now no longer referenced and can be collected
			return nextValue;
		}
		return null;
	}
@ Nullable @ Override public E poll ( ) { LinkedQueueNode < E > currConsumerNode = consumerNode ; // don't load twice, it's alright LinkedQueueNode < E > nextNode = currConsumerNode . lvNext ( ) ; if ( nextNode != null ) { // we have to null out the value because we are going to hang on to the node final E nextValue = nextNode . getAndNullValue ( ) ; // Fix up the next ref of currConsumerNode to prevent promoted nodes from keeping new ones alive. // We use a reference to self instead of null because null is already a meaningful value (the next of // producer node is null). currConsumerNode . soNext ( currConsumerNode ) ; CONSUMER_NODE_UPDATER . lazySet ( this , nextNode ) ; // currConsumerNode is now no longer referenced and can be collected return nextValue ; } else if ( currConsumerNode != producerNode ) { while ( ( nextNode = currConsumerNode . lvNext ( ) ) == null ) { } // got the next node... // we have to null out the value because we are going to hang on to the node final E nextValue = nextNode . getAndNullValue ( ) ; // Fix up the next ref of currConsumerNode to prevent promoted nodes from keeping new ones alive. // We use a reference to self instead of null because null is already a meaningful value (the next of // producer node is null). currConsumerNode . soNext ( currConsumerNode ) ; CONSUMER_NODE_UPDATER . lazySet ( this , nextNode ) ; // currConsumerNode is now no longer referenced and can be collected return nextValue ; } return null ; }
{@inheritDoc} <br>
<p>
IMPLEMENTATION NOTES:<br>
Poll is allowed from a SINGLE thread.<br>
Poll reads the next node from the consumerNode and:
<ol>
<li>If it is null, the queue is assumed empty (though it might not be).
<li>If it is not null set it as the consumer node and return it's now evacuated value.
</ol>
This means the consumerNode.value is always null, which is also the starting point for the queue.
Because null values are not allowed to be offered this is the only node with it's value set to null at
any one time.

@see java.util.Queue#poll()
{ @inheritDoc } <br > <p > IMPLEMENTATION NOTES : <br > Poll is allowed from a SINGLE thread . <br > Poll reads the next node from the consumerNode and : <ol > <li > If it is null the queue is assumed empty ( though it might not be ) . <li > If it is not null set it as the consumer node and return it s now evacuated value . < / ol > This means the consumerNode . value is always null which is also the starting point for the queue . Because null values are not allowed to be offered this is the only node with it s value set to null at any one time .