Open sckott opened 9 years ago
Good idea. Definitely worth using when testing other functions... This could be:
Alternatively:
limit = Inf
(default): get alllimit >= 1
: make limit
requestslimit
< 1: errorRight, the confusing part about using integers though is that the user may be thinking if they set limit = 10
, they'll get 10 records/identifiers/etc., but in reality, 10 http requests are made (if that many required), with probably 50 results X 10 requests = 500 results. I guess we can just make clear in docs.
Alternatively, we could have user's input integers for how many records they want, then keep track of how many we've downloaded, etc. However, this gets complicated, maybe something to do later on.
I think it may be clarified in the docs. We can also call the argument max_requests
.
Alternatively, we could have user's input integers for how many records they want, then keep track of how many we've downloaded, etc. However, this gets complicated, maybe something to do later on.
Actually why would anybody be determined to fetch only some small number of records? Limiting number of requests makes sense for testing purposes.
Noticed something while making fix in #18 - that we probably need to give user power to determine how much data they get back.
Our while loop will just keep going, getting more data if a resumptionToken is available.
We may not be able to expose a parameter that does this exactly, like
limit = 10
, and you get 10 results, but at least it could be something likelimit = "all"
(all results)limit = "one"
(do one HTTP request, then stop, so even if get a resumptionToken, stop anyway)