micron is a multiple input multiple output broadcasting program.
- Implemented using event driven I/O.
- Data is stored in a central shared ring buffer [0, M-1], with shared cursor location c.
- Each peer has a position p in the ring buffer.
- Toggles of read/write/accept interest flags are done using a delay queue and a separate thread.
You can build directly on your local machine using maven, or use the provided Dockerfile.
docker build -t micron .
docker run -p 1337:1337 micron
yes a | nc localhost 1337
yes b | nc localhost 1337
- requires Java 17 or greater
- you should see as and bs interleaved in the output, roughly equally, and this will generalize to as many connected peers as there are.
- you can tail the metrics using:
tail -f logs/metrics.log
; this will show some basic metrics and gauges about performance.