-
Notifications
You must be signed in to change notification settings - Fork 26
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
[INSPIRATION ONLY] - pseudo-implement asynchronous request-reply design [DO NOT MERGE] #1490
Conversation
@thomasyu888 very interesting. I looked into turning schematic APIs to async a long time ago when we were still doing tiger team, and also saw |
@thomasyu888 how did you make this diagram? |
Thanks both for looking at this! @linglp before you dive deeper into this, lets focus on the tasks at hand and we can align as a group what gets tackled next @afwillia See this. That said, you can write a GPT prompt like this:
|
If we implement an async job queue in front of schematic. Now schematic would intentionally have request-to-request persistence. We would likely want to match the sub in the JWT claim to the status of the job they're requesting to make sure they match. This is to ensure we are properly having an authorization check in place to prevent user "A" from requesting information about the job of user "B". |
Problem
There are endpoints that take > 1 second to return a response, it is best practice for API endpoints for these to return fast
Solution
Use celery + redis and the async request reply design pattern. https://learn.microsoft.com/en-us/azure/architecture/patterns/async-request-reply. NOTE: this PR does not fully work, but it meant to showcase some tech that can be used.
What didn't work about this PR was the connection between redis and celery in the docker containers locally.
Here's a rough sequence diagram that may not be fully correct (ie the status codes, etc)