You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do we have any official documentation about Websockets? #104
Thanks for bringing this up. As of now, there’s no official WebSocket support in PyNest. We totally get how handy it can be, and it’s definitely on our roadmap. If you have any ideas or rough proof-of-concept code, feel free to share! We’d love to hear your thoughts on what a clean, developer-friendly API might look like.
I initially closed the issue yesterday, as I was considering rearchitecting our app to use only FastAPI instead of continuing with PyNest. However, since we've already invested significant effort into building with PyNest, a full rearchitecture might be too much work at this stage.
I've reopened the issue for further discussion. Our team is developing an app that requires a WebSocket-like connection to an endpoint to fetch real-time data from background tasks. If PyNest doesn’t support WebSockets, polling might be our only option. Do you have any suggestions on how we can work around this?
Just write down another comment here that I found something called Server-sent Events, which might benefit our team. Does PyNest support Server-sent Events?
Why don't we just implement support in Web Sockets? It shouldn't be a huge effort and if you and your team can benefit from it, then as the maintainer of pynest this is something I want to support.
But for that, I need to have better understand of your use case. could you share here or in private (itay2803@gmail.com) your use case and your needs (why do you need web sockets, how this is integrate with the rest of your app and more)
We’re building a system that interacts with a third-party API to handle creation tasks. Since the API doesn’t provide a callback or status endpoint to indicate when the creation is complete, we’ve moved the task to the background using Redis and Dramatiq.
When a user initiates creation, they’re redirected to a listing page where items show badges indicating whether they’re ready to view/edit or still pending. This is where we think WebSocket support would be especially useful—to push real-time status updates for each item’s creation progress.
PyNest 0.5.0 comes with built-in WebSocket support.
The release includes first-class gateway APIs such as @WebSocketGateway, @SubscribeMessage, MessageBody, ConnectedSocket, lifecycle hooks, and official documentation for the recommended PyNest WebSocket pattern.
Resolved by #127 and released in PyNest v0.5.0. PyNest now provides native WebSocket gateways with @WebSocketGateway, @SubscribeMessage, MessageBody, ConnectedSocket, dependency injection, guards, rooms/broadcasting, CLI scaffolding, tests, and official documentation.
Activity
ItayTheDar commentedon Mar 15, 2025
Hi @thongtr-dev
Thanks for bringing this up. As of now, there’s no official WebSocket support in PyNest. We totally get how handy it can be, and it’s definitely on our roadmap. If you have any ideas or rough proof-of-concept code, feel free to share! We’d love to hear your thoughts on what a clean, developer-friendly API might look like.
thongtrump commentedon Apr 4, 2025
Thank you for your comment @ItayTheDar .
I initially closed the issue yesterday, as I was considering rearchitecting our app to use only FastAPI instead of continuing with PyNest. However, since we've already invested significant effort into building with PyNest, a full rearchitecture might be too much work at this stage.
I've reopened the issue for further discussion. Our team is developing an app that requires a WebSocket-like connection to an endpoint to fetch real-time data from background tasks. If PyNest doesn’t support WebSockets, polling might be our only option. Do you have any suggestions on how we can work around this?
thongtrump commentedon Apr 4, 2025
Just write down another comment here that I found something called Server-sent Events, which might benefit our team. Does PyNest support Server-sent Events?
ItayTheDar commentedon Apr 6, 2025
Hi @thongtr-dev
Why don't we just implement support in Web Sockets? It shouldn't be a huge effort and if you and your team can benefit from it, then as the maintainer of pynest this is something I want to support.
But for that, I need to have better understand of your use case. could you share here or in private (itay2803@gmail.com) your use case and your needs (why do you need web sockets, how this is integrate with the rest of your app and more)
Thank you!
thongtrump commentedon Apr 11, 2025
Hi @ItayTheDar,
We’re building a system that interacts with a third-party API to handle creation tasks. Since the API doesn’t provide a callback or status endpoint to indicate when the creation is complete, we’ve moved the task to the background using Redis and Dramatiq.
When a user initiates creation, they’re redirected to a listing page where items show badges indicating whether they’re ready to view/edit or still pending. This is where we think WebSocket support would be especially useful—to push real-time status updates for each item’s creation progress.
ItayTheDar commentedon May 9, 2026
PyNest 0.5.0 comes with built-in WebSocket support.
The release includes first-class gateway APIs such as
@WebSocketGateway,@SubscribeMessage,MessageBody,ConnectedSocket, lifecycle hooks, and official documentation for the recommended PyNest WebSocket pattern.ItayTheDar commentedon Jul 28, 2026
Resolved by #127 and released in PyNest v0.5.0. PyNest now provides native WebSocket gateways with
@WebSocketGateway,@SubscribeMessage,MessageBody,ConnectedSocket, dependency injection, guards, rooms/broadcasting, CLI scaffolding, tests, and official documentation.Closing as completed.