heroku-examples / go-websocket-chat-demo

102 stars 49 forks source link

Configurable Multi Channel Chat Support #8

Open rmattam opened 6 years ago

rmattam commented 6 years ago

An attempt to write idiomatic go code and better encapsulate subscription and client handling into a dedicated package.

The Idea is to spawn multiple chat channels just by configuring channel name and websocket path in the routes.go file. The idea is to loop through a websocket config collection and using closure to initialize distinct instances for each configured channel, listening to redis messages on the subscribed channels.

This demo helped me a lot to set up chat server on heroku, I had to extend to support multiple channels to make it work for my use case.

Hope my contribution helps some one who faced the same problem as me.

you can check this medium article for more info : https://medium.com/@rahulroymattam/a-scalable-multi-channel-golang-messaging-server-on-heroku-edf7b236b7ff

freeformz commented 5 years ago

I know this is super old, but if you want to rebase and resolve conflicts I'd be happy to review.