A concurrent key-value messaging system and squarer implementation in Go. This project demonstrates fundamental concurrency patterns including goroutines, channels, client-server communication, and buffered message queuing.
This project is split into two components:
A TCP server that supports multiple concurrent clients and basic key-value operations:
Put:key:value– Adds a value to a list of values for the given key.Get:key– Retrieves all values for the given key.Delete:key– Removes all values associated with the key.Update:key:oldValue:newValue– Replaces an existing value with a new one.
- Fully concurrent server using goroutines and channels.
- Buffered per-client message queues (with drop mechanism).
- Command logging with timestamp.
- Active and dropped client counters.
A concurrent squarer that receives integers via a channel, squares them, and sends results through an output channel. Accompanied by unit tests covering:
- Basic correctness
- Multiple inputs
- Negative numbers
- Zero
- Empty channel behavior
- Non-blocking squaring logic using select statements.
- Graceful shutdown with
Close()method. - Tested for correctness with multiple inputs, negatives, zero, and timeout scenarios.