-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix: provide websocket instead of stream to avoid potential backpressure issues (#289) #290
Conversation
@mcollina As discussed here #289 (comment) I've removed stream creation completely. Another option here is to provide an object of shape Also, could be nice to provide a function to convert that socket into a stream; so the object could even be I can update this PR to include either of the aforementioned solutions. |
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.
Can you please document how to get a WebSocketStream in the README?
I don't think having a specific function is needed, let's just document how to create it using ws. |
@mcollina I've added an example to README.md |
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.
lgtm
CI is failing |
@mcollina Resolved, for some reason the unit test was relying on the count of fastify log items to be constant, updated it to fail if |
v10 of websocket required refactor: fastify/fastify-websocket#290
Now
createWebSocketStream
is not called therefore there are no memory leaks/backpressure to worry about.Checklist
npm run test
andnpm run benchmark
and the Code of conduct