Skip to content
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

Get all items #187

Merged
merged 10 commits into from Jan 4, 2015
Merged

Get all items #187

merged 10 commits into from Jan 4, 2015

Conversation

vermiculus
Copy link
Owner

Implement a means to get all pages of a method call. Can be used in tag-bot.

This function repeatedly makes API requests until a condition is
satisfied (such as 'no more items').

First and foremost, this will allow us to retrieve all tags for a site.
@vermiculus
Copy link
Owner Author

Strictly speaking, the get-all function should recognize backoff and wait some multiple of the given delay (or some set amount). This would be a blocking call, though…

@vermiculus vermiculus mentioned this pull request Jan 2, 2015
@vermiculus
Copy link
Owner Author

Actually, backoff will tell you how long to wait before making another request. It might be worthwhile to factor this into sx-request -- recording the time of request that returned backoff and the delay that it said, then checking before making the request if the timing is ok.

It doesn't really make sense.
Dumb mistake -- I wasn't taking the length of the request before
comparing it.
@vermiculus vermiculus mentioned this pull request Jan 3, 2015
@Malabarba
Copy link
Collaborator

(Moved my comment to #188)

than `sx-request-response-get-items') to allow STOP-WHEN to
access the response wrapper."
;; @TODO: Refactor. This is the product of a late-night jam
;; session... it is not intended to be model code.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the warning. :-)

@Malabarba
Copy link
Collaborator

Just made some small comments. Merge away when you'd like. 👍

@vermiculus
Copy link
Owner Author

I accidentally made the changes for your comments under #189 – since there were no functional changes, I'm going to merge. Thanks for looking this over!

vermiculus added a commit that referenced this pull request Jan 4, 2015
@vermiculus vermiculus merged commit 3d35ecf into master Jan 4, 2015
@vermiculus vermiculus deleted the get-all branch January 4, 2015 04:30
@Malabarba
Copy link
Collaborator

No problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants