Detect next page presence for paginated requests
Problem
When a limit is set, lines.Send()
stops sending new lines either because
no more elements exist or because the limit was reached.
The receiver cannot distinguish between these two cases, but needs to know if a next page exists for pagination requests.
Solution
- Extract
readChunks()
function to manage the reading flow - Provide
hasNextPage
flag to the receiver
Edited by Vasilii Iakliushin