tinypubsub is a minimal, in-memory TCP-based publish–subscribe server written in Go.
This is a toy project built to explore Go concurrency, channels, and event-driven design.
There is no persistence and no durability. Restarting the server resets all state.
- TCP server using Go’s
netpackage - Simple text-based protocol
- In-memory topic subscriptions
- Fan-out message delivery using Go channels
- Single event loop for state mutation
make buildThis builds the binary at:
./bin/tinypubsub
./bin/tinypubsubThe server listens on port 9000.
Connect using nc (netcat):
nc localhost 9000SUB <topic> Subscribe to a topic
UNSUB <topic> Unsubscribe from a topic
PUB <topic> <msg> Publish a message to a topic
LIST List subscribed topics
EXIT Close the connection
SUB sports
PUB sports hello world
LIST
UNSUB sports
EXIT
- All state is in-memory
- No authentication
- No persistence
- Not safe for production use
This project exists purely for learning and experimentation.