-
Notifications
You must be signed in to change notification settings - Fork 1
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
Asynchronous versions of API wrappers #278
Comments
Thanks for the feature request! We will definitely consider it. What is the use case you are looking at in this scenario though? Ideally you would use the generator capabilities in For example, you can use the below code to automatically paginate through all files without hanging on a single request. The generator automatically paginates the requests when iterated through.
By default you will get 50 results per page, but you can tune this by passing the
|
My lab is building a project that will hopefully index all the datasets from NIH-supported scientific data repositories. So researchers could, for example start their search from our site with a general idea of what they're looking for, and we would send them to a the 4DN page for some dataset if it was a good match. So my use case is that we need to semi-regularly ingest large quantities of metadata from 134 data-repositories such as 4DN. The pagination is a fair solution for most use cases, but I think it it likely to increase my global lock time in O(1/n), where n is the number of results per page. |
We’re guessing it may suffice for your purposes to use As a career language designer myself, I tend toward wanting our tools to offer a consistent theory of how to achieve certain kinds of goals. While I don’t doubt that the (If I had more time, the issues I’d want to consider relate to overall sense of resource use. The |
It would be wonderful if we had asynchronous versions of the API call wrapper functions in this library.
For example, if we had an asynchronous function
dcicutils.ff_utils.afaceted_search
, then it would be "awaitable", meaning users could run the following code:This would ensure the library isn't holding up the client's global interpreter lock while the server is putting together the metadata for possibly thousands of records.
The text was updated successfully, but these errors were encountered: