@Nullable
	public T poll() throws Exception {
		if (exception != null) throw exception;

		if (put != null && willBeExhausted()) {
			T item = doPoll();
			SettablePromise<Void> put = this.put;
			this.put = null;
			put.set(null);
			return item;
		}

		return !isEmpty() ? doPoll() : null;
	}
@ Nullable public T poll ( ) throws Exception { if ( exception != null ) throw exception ; if ( put != null && willBeExhausted ( ) ) { T item = doPoll ( ) ; SettablePromise < Void > put = this . put ; this . put = null ; put . set ( null ) ; return item ; } return ! isEmpty ( ) ? doPoll ( ) : null ; }
Returns the element of {@code head} index of
the buffer if it is not empty, otherwise returns
{@code null}. Increases the value of {@code head}.
<p>
If the buffer will have less elements than {@code bufferMinSize}
after this poll and {@code put} promise is not {@code null},
{@code put} will be set {@code null} after the poll.
<p>
If current {@code exception} is not {@code null},
it will be thrown.

@return element of this buffer at {@code head}
index if the buffer is not empty, otherwise {@code null}
@throws Exception if current {@code exception}
is not {@code null}