Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 1.02 KB

polyethylene.polyasynciterable.prefetch.md

File metadata and controls

25 lines (14 loc) · 1.02 KB

Home > polyethylene > PolyAsyncIterable > prefetch

PolyAsyncIterable.prefetch() method

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

Remarks

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.