olahol / melody

:notes: Minimalist websocket framework for Go
BSD 2-Clause "Simplified" License
3.73k stars 364 forks source link

Question: With gorilla/websocket archived, does melody plan to move to nbio or some other plan? #73

Closed abhishekkr closed 1 year ago

abhishekkr commented 1 year ago

Hi,

Thanks for putting effort into melody. It's the most straight forward Websocket library I've used.

I was hoping to know if melody maintainers plan to move to nbio, else or have some other plans.. now that gorilla/websocket has been archived for about a month.

Things are good at the moment, but some protocol/security issues might come up in recent future. If there is a plan going ahead.

lesismal commented 1 year ago

Glad to see that some of you guys have paid attention to my lib nbio. I like melody's interface design very much, I read the code a few years ago and have learned a lot from it.

Back to this topic, I think there's no need to move melody to nbio. Because gorilla/websocket has been used for such a long time in so many projects and it works well, which means it's stable and would be fine even if stop maintenance.

nbio's websocket implementation is much more than gorilla/websocket. nbio already provides non-blocking and concurrent safe Write/Close interfaces, so, users don't need to handle write by using a separate goroutine themselves on a broadcasting scenario. nbio reads and parses websocket data automatically, so you don't need to handle read yourself, but just need to set OnOpen/OnClose/OnMessage handlers to receive messages or events. For some other needs, maybe you can just config different values of nbio's Engine Config, then it would satisfy your own need.

When using with std http server, I got a better performance from nbio than gorilla in my simple load test. nbio also supports different IO mod to gain balance between performance and cpu/mem cost. When using IOModNonblocking/IOModMixed, users can handle even 1m connections with a limited num of goroutines. For more details about different IO mod, please refer to: https://github.com/lesismal/nbio/releases/tag/v1.3.5

Of course, also welcome to wrap nbio to implement other frameworks! If really need it, would be happy to join.

christopher-kleine commented 1 year ago

Thanks for mentioning nbio. I wasn't even aware it existed!

But the gorilla web toolkit got a new core maintainer. And the "archive" got lifted.

abhishekkr commented 1 year ago

@christopher-kleine yeah, saw that.. glad for Gorilla Web Toolkit, it has been a good project