Noizu.Telegram.Pagination (Noizu Telegram v0.1.0)

Copy Markdown View Source

Offset-based pagination helper over Bot API list endpoints.

Most Telegram endpoints return a full list per call (getUpdates uses the offset protocol instead — see Noizu.Telegram.Updates.stream/1). This module covers offset/limit walking of list results:

Noizu.Telegram.Pagination.stream(fetch_fn, offset: 0, limit: 100)

fetch_fn.(offset, limit) returns {:ok, list}; the stream stops on an empty or short page.

Summary

Functions

stream(fetch, opts \\ [])

@spec stream((term(), pos_integer() -> {:ok, [term()]}), keyword()) :: Enumerable.t()