The raw response shape of a single page or chunk.
Callback that fetches a single entry given its numeric page key.
Reads the "more data available" flag from a fetched entry. Return false for malformed responses so a broken payload ends the traversal instead of looping forever.
The 1-based page number to start from.
Hard cap on entries fetched, guarding against unbounded loops.
Maximum number of requests kept in flight at once.
Optionalsignal: AbortSignal
Optional AbortSignal to cancel the traversal.
OptionalextractBound: (response: TEntry) => number | undefined
Optional reader for the terminal page bound a fetched entry reports (AniList's pageInfo.lastPage). Supply it only when entry numbers are page numbers; chunk-style traversals omit it so their scheduling is governed solely by the terminal entry and guard checks.
The responses in entry order, how many were fetched, and whether the guard or a reported launch bound truncated the run.
Shared look-ahead driver for paged traversals.
Fetches entries through a sliding window of at most
concurrencylaunched- but-unconsumed requests so round-trip latency overlaps instead of stacking, while results are appended strictly in entry order no matter when each request settles. Scheduling stops as soon as an entry reports "no more data" (per the caller-suppliedextractHasMore), at themaxEntriesguard, or, whenextractBoundis supplied, at the smallest launch bound a received entry reported;truncatedmirrors the sequential semantics.Because the window runs ahead of consumption, up to
concurrency - 1already-launched requests may complete past a terminal entry; their payloads are drained and discarded so the collected prefix matches what a strictly sequential traversal would have returned.When the optional
signalis aborted, any in-flight requests are settled (their payloads discarded) and the entries collected so far are returned as a partial result withtruncated: false. The abort is not propagated as a rejection.