-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can pagination be automatic? #40
Comments
Since every page is a separate request this feature can cause you inadvertently exceed request rate limit for really large lists. And I don't think you want that. |
I agree with @sergeyromanov, pagination is there for a reason. For example, you really don't want to slurp info about all commits at once. The solution is no good, but the problem is totally valid. The user must always consider pagination for any list call, but it's poorly integrated into Net::GitHub::V3. One solution would be to use an iterator for lists...
Or a callback.
I prefer the iterator, it offers more control to the user. An advantage is to reduce the need to ask for another page just to see if you're done. The iteration can be smart enough to notice that the last page returned less than |
@nebulous @schwern Pithub (aka yet another GitHub API wrapper) has an explicit auto_pagination attribute, which you can toggle on at your own risk. |
E |
I would like to see auto pagination as an attribute to the constructor ala Pithub. Maybe the user does want all the commits. Given the rate limiting features of this module, I don't see why it would be a problem. |
Filed as an issue because I'm not sure if it's worthy of pull request, but the following has worked reasonably well for me to automatically dig thru pages. 1c3ba0a
The text was updated successfully, but these errors were encountered: