Skip to content

Conversation

@opalmer
Copy link
Member

@opalmer opalmer commented Oct 14, 2015

So while working on #334 it's become more apparent that in order to handle exceptions properly and generally cleanup the assignment APIs we need to do a little work converting it to inlineCallbacks. Otherwise we can end up with a response going back to a client before a job type is actually loaded causing exceptions to possibly swallowed.

The modification of the assignment API to use inlineCallbacks will be broken down into another CL but for now this PR modifies some of the code from this style of response:

request.setResponseCode(ACCEPTED)
request.write(dumps({"id": assignment_uuid}))
request.finish()
return NOT_DONE_YET

to:

return dumps({"id": assignment_uuid}), ACCEPTED

This approach is cleaner and tightens the coupling some between the request being made and when the response is sent.

@opalmer opalmer self-assigned this Oct 14, 2015
@opalmer opalmer added this to the 0.8.7 milestone Oct 14, 2015
@opalmer
Copy link
Member Author

opalmer commented Oct 14, 2015

@guidow, PTAL

@opalmer opalmer changed the title Assign API Use Return Tuples Modify assign API to respond directly with tuples Oct 14, 2015
@opalmer
Copy link
Member Author

opalmer commented Oct 24, 2015

@guidow, any comments on this one?

@guidow
Copy link
Contributor

guidow commented Oct 28, 2015

Looks good. Sorry for the long delay.

@opalmer
Copy link
Member Author

opalmer commented Oct 28, 2015

No problem, thanks for the comment. Merging.

opalmer added a commit that referenced this pull request Oct 28, 2015
Modify assign API to respond directly with tuples
@opalmer opalmer merged commit 73c53b7 into master Oct 28, 2015
@opalmer opalmer deleted the assign_return_tuples branch October 28, 2015 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants