|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
SignalConsumer implementation — JSON serialisation and batched I/O. More...
Go to the source code of this file.
Namespaces | |
| namespace | srfm |
| namespace | srfm::stream |
SignalConsumer implementation — JSON serialisation and batched I/O.
See include/srfm/stream/signal_consumer.hpp for the full module contract.
{"bar": 0, "beta": 0.0000, "gamma": 1.0000, "regime": "LIGHTLIKE", "signal": 0.0000}
std::fflush() is expensive. We accumulate FLUSH_INTERVAL signals in the internal buffer (backed by the OS I/O buffer) before flushing. On stop(), we drain the ring and perform a final flush to ensure no signals are lost.
std::fprintf() is used rather than std::cout to avoid locale effects and C++ stream synchronisation overhead. The format string is compile-time constant; no dynamic allocation occurs in write_one().
Definition in file signal_consumer.cpp.