Home > polyethylene > PolyAsyncIterable > prefetch
Return the same iteration, but with its elements requested with anticipation to allow for asynchronous operations to begin and reduce wait times.
Signature:
prefetch(): PolyAsyncIterable<T>;
Returns:
PolyAsyncIterable<T>
a new PolyAsyncIterable that prefetched the iterated elementsd
When yielding an element of this iterable, the next one will be also requested internally, so that any asynchronous operations are started before their results are needed.
Note that after calling this mehtod, more elements than strictly needed might be requested from the previous iterable, triggering any potential side effects.