Skip to content
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

Finish other half of async events system #158

Open
jakerye opened this issue Oct 11, 2018 · 0 comments
Open

Finish other half of async events system #158

jakerye opened this issue Oct 11, 2018 · 0 comments
Labels
ARCHIVE These are out of date. enhancement New feature or request

Comments

@jakerye
Copy link
Contributor

jakerye commented Oct 11, 2018

Our events can be broken into 2 major camps

  1. Fast events - actions like checking thread information. These events get FULLY processed and return a 200 status on success.

  2. Slow events - actions like changing device mode. These events get added to an event queue so the thread can process them when it is ready to. For example, we wouldn't want to change modes in the middle of taking a sensor reading. It is better to wait for the reading to complete, have that process check for new events and transitions then act accordingly.

We do however always want to have quick response times from our API and to acknowledge the request has been received. Returning a 200 violates HTTP protocol in this case because there is still processing to be done. It is better to return a 202, or "Accepted" then provide a new task endpoint with an approximation of remaining processing time for the client to call for receiving the full response.

In practice, so far, checking for the post-202 response has not been vital to operation however it is a critical feature for a comprehensive and robust event processing system. This new task endpoint has not been developed yet and it is what this feature request is referring to.

Also in the process of building this out, it will be important to update the 200 response codes to 202s as this design pattern has not been rigidly followed from code inception.

I'm sure what the best way to do this is yet...perhaps an event response queue in the manger with an event ID? So client would POST to /upgrade/response/ with a payload including "id" (could also be a detail route) ... need to handle this for the peripheral events as well which is a bit more general case than the upgrade / resource threads.

@jakerye jakerye added the enhancement New feature or request label Oct 11, 2018
@jakerye jakerye added this to the Infrastructure milestone Jan 30, 2019
@srmoore srmoore added the ARCHIVE These are out of date. label Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARCHIVE These are out of date. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants