Pager

class Pager<T> : Flow<T>

A generic pagination class that implements Flow of T items.

Exposes page-level properties via byPage() flow, or collects all items seamlessly via collect(). This flow is cold, stateless, and thread-safe.

Properties

Link copied to clipboard
Link copied to clipboard
val pageSize: Int? = null

Functions

Link copied to clipboard
fun byPage(): Flow<Page<T>>

Returns a Flow that emits Page objects, allowing granular access to page-level metadata such as Page.nextPageToken and Page.sdkHttpResponse.

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<T>)

Collects and emits all items across all available pages.