reactor-core/src/main/java/reactor/core/publisher/Flux.java
public final Iterable<T> toIterable(int batchSize, @Nullable Supplier<Queue<T>>
			queueProvider) {
		final Supplier<Queue<T>> provider;
		if(queueProvider == null){
			provider = Queues.get(batchSize);
		}
		else{
			provider = queueProvider;
		}
		return new BlockingIterable<>(this, batchSize, provider);
	}
public final Iterable<T> toIterable(int batchSize, @Nullable Supplier<Queue<T>>
			queueProvider) {
		final Supplier<Queue<T>> provider;
		if(queueProvider == null){
			provider = Queues.get(batchSize);
		}
		else{
			provider = queueProvider;
		}
		return new BlockingIterable<>(this, batchSize, provider);
	}
public final Iterable < T > toIterable ( int batchSize , @ Nullable Supplier < Queue < T > > queueProvider ) { final Supplier < Queue < T > > provider ; if ( queueProvider == null ) { provider = Queues . get ( batchSize ) ; } else { provider = queueProvider ; } return new BlockingIterable <> ( this , batchSize , provider ) ; }
Transform this {@link Flux} into a lazy {@link Iterable} blocking on
{@link Iterator#next()} calls.

<p>
<img class="marble" src="doc-files/marbles/toIterableWithBatchSize.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 Iterable}
itself within these threads is ok.

@param batchSize the bounded capacity to prefetch from this {@link Flux} or
{@code Integer.MAX_VALUE} for unbounded demand
@param queueProvider the supplier of the queue implementation to be used for storing
elements emitted faster than the iteration

@return a blocking {@link Iterable}
Transform this { @link Flux } into a lazy { @link Iterable } blocking on { @link Iterator#next () } calls .