-
Notifications
You must be signed in to change notification settings - Fork 3
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
Error status for multiple providers #72
Comments
After pondering this for a while and playing with various options, here's what I suggest. We can support two modes, a synchronous mode where the final answer is transmitted as one object when everything is ready. This is the traditional way of doing things. For your example query above, it might look like this:
This would not arrive until 30 seconds (the timeout) has elapsed but the returned result is a single JSON object. The second, fancy way is to stream objects as they become available with a special final object to signal that the stream is done. this might be:
The objects are transmitted as they become available. Unlike the way they are depicted above, objects do not contain newlines, but are separated by newlines. If an object contains "source" then it is a new transmitted result. If the object contains "responses" then the client knows that that is the final object and it can stop reading from the stream. This allows the first results to be available in seconds with late results trickling in later. This latter model is what we currently use for this page: The client chooses which model they want to use: complete response or streamed objects. either way, the responses from each source are the same and can be accessed with the same code. The content of "psms" is what we current return with /psms The only snag is that this model vastly different than the current /psms. I wanted them to be the same. To make them compatible, we'd need to think about this some more, but I'm out of time for now.. |
As we discussed last week, we will need to have a different definition of errors or status when querying all entry points. The broker will need to retrieve multiple statuses for multiple entry points. We have multiple options here:
statuses
and then we can attach the error as another object in the response. Like (http://www.peptideatlas.org/api/proxi/v0.1/psms?resultType=compact&accession=PXD005942):The second approach define a global object with two parts data and errors.
The text was updated successfully, but these errors were encountered: