Skip to content

Instantly share code, notes, and snippets.

View geekyme's full-sized avatar
💭
I code, a lot

Shawn Lim geekyme

💭
I code, a lot
View GitHub Profile
@geekyme
geekyme / chat.go
Last active June 12, 2018 17:14
Scale websocket connections horizontally using Kafka
package main
/*
This simple chat program illustrates a horizontally scaled, master-client architecture chat server that uses kafka as a distributed pub-sub system
Each server has:
- one kafka consumer group by port
- a map of connected clients (state maintained by the server whenever clients connect and disconnect)
- one kakfa producer