-
Notifications
You must be signed in to change notification settings - Fork 890
Add recommendations for asynchronous processing #792
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
Add recommendations for asynchronous processing #792
Conversation
dd00252
to
64e68de
Compare
Do I need to add some change ? |
64e68de
to
8cfa85e
Compare
At first glance, this is really good stuff. |
}, | ||
"actions": { | ||
"cancel": "/photos/queue/5234/cancel", | ||
"delete": "/photos/queue/5234/delete" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the difference between cancel
and delete
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A job canceled can be restarted. But it's ok for me if a job is only deleted.
@benoittgt Coming back to this... I'd like to see this merged, but it needs a few updates. I'll comment inline. Let me know if you're up for bringing this up to date. |
} | ||
] | ||
}, | ||
"actions": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, this "actions"
container should (temporarily) be removed. We're working on a standard way to support actions (see, e.g., #745) but, until then, I don't want to recommend something that will likely contradict our final solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with that
4d905ce
to
87ef4ab
Compare
"id":"5234", | ||
"attributes":{ | ||
"status":"Process failed, see errors", | ||
"errors":[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These errors shouldn't be here, I don't think, because if the server already knows that the request has errored, it should send back the error (not a 200).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Managing errors seems not related to this recommendation. Errors where discussed here #828. Seems enough for me.
@benoittgt Awesome! I just noted some small grammatical corrections too. Can you please make those, squash this all down to one commit, and then I'll merge it? |
290ea07
to
e804cdb
Compare
Started a discussion on discourse about it : http://discuss.jsonapi.org/t/long-running-jobs-or-asynchronous-processing/26 Maybe the status response have too much infos for this example. Maybe "actions" should not be there. Move "status" and "errors" in an "attributes" bucket Temporary remove "actions" container. Waiting for standard about it. Waiting json-api#745 Remove errors fields Move queue link to content location, add it to 'attributes' Remove links self and grammar corrections Move Header/location to Content-Location
e804cdb
to
d474956
Compare
Thanks Ethan for the time you took to review my PR. 🍶 |
Happy to :) This looks great now. Merged! |
Add recommendations for asynchronous processing
Should this also mention that further requests should return |
Started a discussion on discourse about it : http://discuss.jsonapi.org/t/long-running-jobs-or-asynchronous-processing/26
Maybe the status response have too much infos for this example.
Maybe "actions" should not be there.
Any feedbacks more than welcome.