https://github.com/maxdeliso/micron
multiple input multiple output streaming relay
https://github.com/maxdeliso/micron
broadcasting event-driven java ring-buffer
Last synced: 3 months ago
JSON representation
multiple input multiple output streaming relay
- Host: GitHub
- URL: https://github.com/maxdeliso/micron
- Owner: maxdeliso
- Created: 2019-04-17T16:13:07.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2022-04-14T17:49:02.000Z (almost 4 years ago)
- Last Synced: 2023-03-28T01:13:47.277Z (about 3 years ago)
- Topics: broadcasting, event-driven, java, ring-buffer
- Language: Java
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Abstract
**micron** is a multiple input multiple output broadcasting program.
## Notes
* 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.
## Building
You can build directly on your local machine using maven, or use the provided Dockerfile.
``docker build -t micron .``
## Testing
1. ``docker run -p 1337:1337 micron``
2. ``yes a | nc localhost 1337``
3. ``yes b | nc localhost 1337``
### Notes
* 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.
## References
* https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/channels/SocketChannel.html
* https://en.wikipedia.org/wiki/Circular_buffer