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

Multiple pages at the same time #21

Open
ignacio-chiazzo opened this issue Mar 28, 2020 · 0 comments
Open

Multiple pages at the same time #21

ignacio-chiazzo opened this issue Mar 28, 2020 · 0 comments

Comments

@ignacio-chiazzo
Copy link
Owner

One of the cons of using cursors is that it doesn't let you skip pages. In other words, if you want to get page 100, you need to get page 1, 2,3,4 ..., 99.

It's common that Apps get the count of a set and execute multiple requests in parallel to get all the pages. For instance, if I want to iterate over all products, I will execute a count query products/count.json, grab that number (e.g. 1000) and then divide it by the size of a page (e.g. 100), that'll give you how many requests/pages you have to execute (e.g. 1000/100 = 10 requests). Then, I'll execute the requests at the same time and wait for the results.

With Cursor based pagination you will have to do sequential requests, however, it doesn't mean that it's slower in all cases. I open this issue so we can add a new column in the results where it compares the performance using requests in parallel.

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

No branches or pull requests

1 participant