Refactor WebSocket
If you refer to this test that I have added : https://github.com/gofr-dev/gofr/blob/14e1c54ddc677d9bc752e50f34a546e7a1d61fe4/pkg/gofr/context_test.go#L82 , you will notice, we need to mention a number of things while implementing a web socket handler. This is not at all intuitive and a better design pattern need to be accommodated/extended.
It is currently implemented the same way, that is HTTP and web sockets both accept only context in their handlers. Modifying the signature will be a breaking change. However we can go around it. Wanted to hear his/her's internal implementation. It is not very robust in current situation(user has to himself write and handle multiple edge cases) and there is no observability as well.
Also web sockets, HTTP, gRPC all follow a similar hander signature for abstraction, with *gofr.Context support.
I think, we want to introduce higher-level WebSocket abstraction and redesign the handler signature.
eg. app.WebSocket("/ws", func(conn *gofr.WSConn) error { ... })
I think, we want to introduce higher-level WebSocket abstraction and redesign the handler signature.
eg.
app.WebSocket("/ws", func(conn *gofr.WSConn) error { ... })
So we need to follow the HTTP signature itself. However, would be interested in understanding your implementation suggestion. Let me know. Refer to the edited PR description.