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

Use generator for get_all_serial #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

copperwall
Copy link

get_all_serial is used to iterate through a paginated response from
shipwire's API. Previously it would add each batch of items to a list
and then return that list once there were no more results to get.

This changes get_all_serial to be a generator, so that the program only
has to keep a single batch's worth of items in memory at a time. This is
especially helpful for grabbing large datasets from shipwire, because
you can begin processing resource items from shipwire while there are still items
to be fetched.

get_all_serial is used to iterate through a paginated response from
shipwire's API. Previously it would add each batch of items to a list
and then return that list once there were no more results to get.

This changes get_all_serial to be a generator, so that the program only
has to keep a single batch's worth of items in memory at a time. This is
especially helpful for grabbing large datasets from shipwire, because
you can begin processing items from shipwire while there are still items
to be requested.
@copperwall copperwall force-pushed the use-generator-for-get-all-serial branch from ae85f12 to c3b7e7a Compare January 16, 2018 05:19
@coveralls
Copy link

coveralls commented Jan 16, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling c3b7e7a on copperwall:use-generator-for-get-all-serial into 65783bc on soylentme:master.

1 similar comment
@coveralls
Copy link

coveralls commented Jan 16, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling c3b7e7a on copperwall:use-generator-for-get-all-serial into 65783bc on soylentme:master.

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

Successfully merging this pull request may close these issues.

2 participants