|
VLink 2.0.0
A high-performance communication middleware
|
Time-sorted message relay that buffers and orders messages before delivery. 更多...
#include <bag_reader_processor.h>
类 | |
| struct | Config |
| Configuration for the time-ordered message cache. 更多... | |
Public 类型 | |
| using | OutputCallback |
| Callback type fired for each message in timestamp order. | |
Public 成员函数 | |
| BagReaderProcessor (const Config &config=Config()) | |
Constructs the processor with the given config. | |
| ~BagReaderProcessor () | |
| Destructor – flushes remaining cached messages and stops the processing thread. | |
| void | register_output_callback (OutputCallback &&output_callback) |
| Registers the callback that receives time-ordered messages. | |
| void | push (int64_t timestamp, const std::string &url, ActionType action_type, const Bytes &data) |
| Pushes a message into the time-ordered cache. | |
Time-sorted message relay that buffers and orders messages before delivery.
Thread-safe. Multiple threads may call push() concurrently.
Callback type fired for each message in timestamp order.
Called from an internal processing thread after the cache window has elapsed.
Constructs the processor with the given config.
| config | Cache time and size limits. |
| vlink::BagReaderProcessor::~BagReaderProcessor | ( | ) |
Destructor – flushes remaining cached messages and stops the processing thread.
| void vlink::BagReaderProcessor::push | ( | int64_t | timestamp, |
| const std::string & | url, | ||
| ActionType | action_type, | ||
| const Bytes & | data ) |
Pushes a message into the time-ordered cache.
Thread-safe. The message is inserted into an internal sorted queue keyed by timestamp. Messages are delivered to the OutputCallback after the min_cache_time window has elapsed.
| timestamp | Message timestamp in microseconds. |
| url | Topic URL string. |
| action_type | Action type. |
| data | Serialized payload bytes. |
| void vlink::BagReaderProcessor::register_output_callback | ( | OutputCallback && | output_callback | ) |
Registers the callback that receives time-ordered messages.
Only one callback may be registered. A subsequent call replaces the previous one.
| output_callback | Callback invoked for each message in order. |