public final Stream<T> toStream(int batchSize) {
		final Supplier<Queue<T>> provider;
		provider = Queues.get(batchSize);
		return new BlockingIterable<>(this, batchSize, provider).stream();
	}
public final Stream<T> toStream(int batchSize) {
		final Supplier<Queue<T>> provider;
		provider = Queues.get(batchSize);
		return new BlockingIterable<>(this, batchSize, provider).stream();
	}
public final Stream < T > toStream ( int batchSize ) { final Supplier < Queue < T > > provider ; provider = Queues . get ( batchSize ) ; return new BlockingIterable <> ( this , batchSize , provider ) . stream ( ) ; }
Transform this {@link Flux} into a lazy {@link Stream} blocking for each source
{@link Subscriber#onNext(Object) onNext} call.
<p>
<img class="marble" src="doc-files/marbles/toStreamWithBatchSize.svg" alt="">
<p>
Note that iterating from within threads marked as "non-blocking only" is illegal and will
cause an {@link IllegalStateException} to be thrown, but obtaining the {@link Stream}
itself or applying lazy intermediate operation on the stream within these threads is ok.


@param batchSize the bounded capacity to prefetch from this {@link Flux} or
{@code Integer.MAX_VALUE} for unbounded demand
@return a {@link Stream} of unknown size with onClose attached to {@link Subscription#cancel()}
Transform this { @link Flux } into a lazy { @link Stream } blocking for each source { @link Subscriber#onNext ( Object ) onNext } call . <p > <img class = marble src = doc - files / marbles / toStreamWithBatchSize . svg alt = > <p > Note that iterating from within threads marked as non - blocking only is illegal and will cause an { @link IllegalStateException } to be thrown but obtaining the { @link Stream } itself or applying lazy intermediate operation on the stream within these threads is ok .