-
-
Notifications
You must be signed in to change notification settings - Fork 107
websocket implementation #1549
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
base: go
Are you sure you want to change the base?
websocket implementation #1549
Conversation
moved from http networking to websocket for hooks, bidirectional communication.
|
✅ Deploy Preview for houdinigraphql canceled.
|
AlecAivazis
left a comment
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.
Overall this looks really good! It's a significant upgrade from the current setup so thanks for pushing on this.
|
@AlecAivazis fixes pushed for all comments, kindly review. |
packages/houdini/src/lib/codegen.ts
Outdated
| body: JSON.stringify(payload), | ||
| }) | ||
| // All hooks now use WebSocket | ||
| return await invoke_hook_websocket(name, hook, payload, task_id, port, directory) |
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.
let's remove the _websocket and stick with just invoke_hook since there is only a websocket version now
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.
done
using websocker status 1000a nd 1001 to differncitate, because in case of orchstrator going away we need to kill the underlyuing process else there is memory leak
moved from http networking to websockets for hooks invocation rather we have bidirectional communication now between compiler and orchestrator. There is no schema change, DB already has a column for port in plugin table.
We maintain a map of websocket connection, and we keep an account of pending request, this is still request-response model nothing inherent has changed just the networking layer is websocket now.
This improved upon the existing http netwroking, now our golang process can send message to orchestrator (posing as websocket client) there is a simple interface for messages implemented.
Right now we dont send a lot of info from compiler using the websockets, only sending critical errors propagating in hook invocation and their success message.
Earlier we sent
taskIdandpluginDiras headersNow we can just send them as regular payload.
We have a lot of errors already propagated to hook layer and then being sent to client, looks somewhat liks this
