surrealdb / surrealdb.go

SurrealDB SDK for Golang
https://surrealdb.com
Apache License 2.0
232 stars 60 forks source link

added nhooyr websocket #127

Closed ElecTwix closed 6 months ago

ElecTwix commented 6 months ago

overall better websocket connection this will also help for reconnect later

timpratim commented 6 months ago

Hi @ElecTwix, firstly, I want to thank you for the time and effort you've put into submitting the PR. We genuinely appreciate your initiative to enhance the SDK.

After careful consideration, we've decided not to merge this PR at this time. This decision stems from our current focus on maintaining a minimal set of dependencies and ensuring the SDK remains as streamlined as possible. Introducing another WebSocket implementation could complicate the library's dependency management and potentially impact its long-term maintainability.

Thank you once again for your understanding and your contribution to SurrealDB. Please feel free to reach out if you have any questions.

ElecTwix commented 6 months ago

Hi @timpratim, First of all Thanks for your reply,

While Gorilla is often considered suitable for minimal projects, it might not be the most lightweight option. nhooyr's ws package specifically aims to be minimal and idiomatic for Go, aligning with our focus on a streamlined approach. As you mentioned, "streamlined" and "minimal" are nhooyr's ws main focuses.

Even the Go standard library's websocket package mentions that their package is lacking, so they recommend the nhooyr's ws. src

gedw99 commented 5 months ago

hey all,

nhooyr's usage would have allowed me to call surrealdb.wasm in the browser too.

so then reactive at runtime in browser and server architectures are possible.

gedw99 commented 5 months ago

https://github.com/timpratim rejected it , but why ? it said " minimal set of dependencies "

Maybe do what the NATS team did then. they write their own : https://github.com/nats-io/nats-server/blob/main/server/websocket.go