From e1360ccbb4e952fcbcc9f0066661fd0aff65bca1 Mon Sep 17 00:00:00 2001 From: unai_71 Date: Tue, 10 Mar 2026 17:45:53 +0000 Subject: [PATCH] feat: Updated readme for new feature --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index f334dd7..8859ddb 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,12 @@ The reader never throws on I/O errors; every outcome is expressed through the en ## Producer class / thread `Producer` ([include/Producer.hpp](include/Producer.hpp), [src/core/Producer.cxx](src/core/Producer.cxx)) runs a worker `std::thread` that periodically polls the `SysfsReader` and, when the status is `Enabled`, generates a random integer and forwards it through an injected `send_fn` callback. The polling interval is 1 second under normal conditions and 7 seconds when the sysfs file reports `ErrorTempTooHigh` (cool-down). + +## UnixIpcBridge + +>[!note] +>why unix domain sockets? Because I have more experience with them under linux than with posix shared memmory and semaphore, and I find them easier to unit-test. + +`UnixIpcBridge` ([include/UnixIpcBridge.hpp](include/UnixIpcBridge.hpp), [src/core/UnixIpcBridge.cxx](src/core/UnixIpcBridge.cxx)) is a small helper that connects to a UNIX domain socket and sends a single `int` per call. It opens a new connection for each value, which keeps the protocol stateless and simple. + +**Tests:** [tests/test_unix_ipc.cxx](tests/test_unix_ipc.cxx) — spins up a fake socket server, sends values through the bridge, and asserts they arrive correctly.