-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
API discussion: keeping duplicated methods xyz
/xyz_async
vs having an async kwarg?
#2598
Comments
The With To summarize, if backwards compatibility is not an issue I would get rid of |
Using a kwarg instead of the async-to-sync magic makes sense to me, so if we want to start overhauling services, we can do that. My vague sense is that the We should do a little research on this. https://github.com/search?q=query_region_async&type=Code turns up almost all hits to astroquery tests in various forks. query_region is harder to search for, but So if we want to make a change, let's spell out the proposed API here and discuss further. I'm hearing: remove |
Yes. Missing For VO services, as I've said, it could return a UWS job. The pattern is well documented. Do we have any idea/examples of async non-VO services? I just assume that they return a URL where the data is being staged. The URL is inaccessible until data becomes available. At least this is the pattern that ALMA used to have if I remember correctly. If that's the case, the simplest is to assume that this is what the return should be - a response with a redirect URL that the client needs to check for when the results become available. We'll need to figure out if that's possible to achieve with VO services too. With these services we might want to return more details about the jobs for clients that could make use of that info. |
No, if we're talking about a unified method, The original idea for |
@keflavich My experience (primarily with MAST, but I've been thinking about the construction while working on the new NEOCC service too) matches with yours in that the async versions have been primarily useful for debugging for modules that don't have a truly asynchronous option. |
Yet another occasion when I'm running into the async vs sync question:
|
Not an easy choice, especially with TAP. For TAP, the duration of the query is not deterministic, so The client can also implement a hybrid mode, where the API is sync, but underneath uses the service async endpoint to start jobs and periodically check their status until they complete. In this mode they do not have to deal with the jobs. Does this help at all? |
OK, gotcha, this helps a lot, thank you. |
While I was reviewing #2597, I run into this quasi-dilemma, but I raise it as a separate question for @keflavich and @andamian, as well as @ceb8.
We have a lot of historical baggage around our API, and I would like to revisit some of it to see whether they still make sense, or we should slowly deprecate them out. At some point we need to switch versioning anyway, so one big breath and breaking API doesn't feel off the table.
So, the question for async and sync jobs: we traditionally have
method_async
andmethod
, auto-generated withasync_to_sync
. But some modules don't follow this, and some modules manually have duplicated methods. So I wonder, now as we move on towards using proper VO tools, and pyvo, whether we want to revisit our API preferences, and would rather go with this kwarg-driven approach? Or the method duplication is better? (And frankly, it's baked into the API too much already that if it's the same, we could just stick with it).I very much interested in the take from Adrian, whether it made any sense to you while redoing e.g.
alma
, or it was something to go along with?The text was updated successfully, but these errors were encountered: