static <E> RingBuffer<E> createSingleProducer(Supplier<E> factory,
			int bufferSize,
			WaitStrategy waitStrategy,
			@Nullable Runnable spinObserver) {
    """
	Create a new single producer RingBuffer with the specified wait strategy.
	<p>See {@code MultiProducerRingBuffer}.
	@param <E> the element type
	@param factory used to create the events within the ring buffer.
	@param bufferSize number of elements to create within the ring buffer.
	@param waitStrategy used to determine how to wait for new elements to become available.
	@param spinObserver called each time the next claim is spinning and waiting for a slot
	@return the new RingBuffer instance
    """
		SingleProducerSequencer sequencer = new SingleProducerSequencer(bufferSize, waitStrategy, spinObserver);

		if (hasUnsafe() && Queues.isPowerOfTwo(bufferSize)) {
			return new UnsafeRingBuffer<>(factory, sequencer);
		}
		else {
			return new NotFunRingBuffer<>(factory, sequencer);
		}
	}
static <E> RingBuffer<E> createSingleProducer(Supplier<E> factory,
			int bufferSize,
			WaitStrategy waitStrategy,
			@Nullable Runnable spinObserver) {
		SingleProducerSequencer sequencer = new SingleProducerSequencer(bufferSize, waitStrategy, spinObserver);

		if (hasUnsafe() && Queues.isPowerOfTwo(bufferSize)) {
			return new UnsafeRingBuffer<>(factory, sequencer);
		}
		else {
			return new NotFunRingBuffer<>(factory, sequencer);
		}
	}
static < E > RingBuffer < E > createSingleProducer ( Supplier < E > factory , int bufferSize , WaitStrategy waitStrategy , @ Nullable Runnable spinObserver ) { SingleProducerSequencer sequencer = new SingleProducerSequencer ( bufferSize , waitStrategy , spinObserver ) ; if ( hasUnsafe ( ) && Queues . isPowerOfTwo ( bufferSize ) ) { return new UnsafeRingBuffer <> ( factory , sequencer ) ; } else { return new NotFunRingBuffer <> ( factory , sequencer ) ; } }
Create a new single producer RingBuffer with the specified wait strategy.
<p>See {@code MultiProducerRingBuffer}.
@param <E> the element type
@param factory used to create the events within the ring buffer.
@param bufferSize number of elements to create within the ring buffer.
@param waitStrategy used to determine how to wait for new elements to become available.
@param spinObserver called each time the next claim is spinning and waiting for a slot
@return the new RingBuffer instance
Create a new single producer RingBuffer with the specified wait strategy . <p > See {