![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Multi-tier event bus for routing SharedColumnBatch events. More...
#include <event_bus.hpp>
Classes | |
| struct | Stats |
| Snapshot of cumulative event bus counters. More... | |
Public Types | |
| using | Options = EventBusOptions |
| Alias for the options struct. | |
| using | Channel = MpmcRing< SharedColumnBatch > |
| Tier-1 dedicated channel type (MpmcRing used as SPSC when single-writer). | |
Public Member Functions | |
| EventBus (Options opts={}) | |
| Construct an EventBus with the given options. | |
| EventBus (EventBus &&)=delete | |
| Non-movable (contains mutex). | |
| EventBus & | operator= (EventBus &&)=delete |
| Non-movable (contains mutex). | |
| EventBus (const EventBus &)=delete | |
| EventBus & | operator= (const EventBus &)=delete |
| ~EventBus ()=default | |
| std::shared_ptr< Channel > | make_channel (const std::string &name, size_t capacity=0) |
| Create (or return existing) named SPSC/MPSC channel. | |
| std::shared_ptr< Channel > | channel (const std::string &name) const |
| Look up an existing channel by name. | |
| bool | publish (SharedColumnBatch batch) |
| Publish a batch to the shared Tier-2 ring. | |
| bool | pop (SharedColumnBatch &out) |
| Pop a batch from the shared Tier-2 ring (for worker threads). | |
| void | attach_sink (std::shared_ptr< StreamingSink > sink) |
| Attach a StreamingSink for Tier-3 durable logging. | |
| void | detach_sink () |
| Detach the currently attached Tier-3 sink (no-op if none attached). | |
| bool | has_sink () const |
| Check whether a Tier-3 StreamingSink is currently attached. | |
| Stats | stats () const noexcept |
| Return a snapshot of the cumulative event bus statistics. | |
| void | reset_stats () noexcept |
| Reset all counters to zero. | |
| size_t | tier2_size () const noexcept |
| Approximate number of batches currently in the Tier-2 ring. | |
| size_t | tier2_capacity () const noexcept |
| Capacity of the Tier-2 MPMC ring (power-of-two, set by EventBusOptions). | |
| size_t | num_channels () const |
| Number of named Tier-1 channels that have been created. | |
Multi-tier event bus for routing SharedColumnBatch events.
Routes batches through three tiers:
The bus is non-copyable and non-movable due to its internal mutex. Wrap in std::unique_ptr<EventBus> if heap allocation is needed.
Definition at line 88 of file event_bus.hpp.
Tier-1 dedicated channel type (MpmcRing used as SPSC when single-writer).
Definition at line 98 of file event_bus.hpp.
Alias for the options struct.
Definition at line 91 of file event_bus.hpp.
|
inlineexplicit |
Construct an EventBus with the given options.
| opts | Configuration controlling tier capacities and Tier-3 enablement. |
Definition at line 106 of file event_bus.hpp.
|
delete |
Non-movable (contains mutex).
|
delete |
|
default |
|
inline |
Attach a StreamingSink for Tier-3 durable logging.
| sink | Shared pointer to a StreamingSink (bus shares ownership). |
Definition at line 191 of file event_bus.hpp.
|
inline |
Look up an existing channel by name.
| name | Logical channel identifier. |
Definition at line 141 of file event_bus.hpp.
|
inline |
Detach the currently attached Tier-3 sink (no-op if none attached).
Definition at line 197 of file event_bus.hpp.
|
inline |
Check whether a Tier-3 StreamingSink is currently attached.
Definition at line 204 of file event_bus.hpp.
|
inline |
Create (or return existing) named SPSC/MPSC channel.
| name | Logical channel identifier. |
| capacity | Ring capacity (0 → use opts_.tier1_capacity). |
Definition at line 125 of file event_bus.hpp.
|
inline |
Number of named Tier-1 channels that have been created.
Definition at line 246 of file event_bus.hpp.
|
inline |
Pop a batch from the shared Tier-2 ring (for worker threads).
| out | Receives the popped batch on success. |
Definition at line 180 of file event_bus.hpp.
|
inline |
Publish a batch to the shared Tier-2 ring.
Also forwards to Tier-3 sink (if attached and opts_.enable_tier3).
| batch | The column batch to publish (moved into the ring). |
Definition at line 158 of file event_bus.hpp.
|
inlinenoexcept |
Reset all counters to zero.
Definition at line 231 of file event_bus.hpp.
|
inlinenoexcept |
Return a snapshot of the cumulative event bus statistics.
Definition at line 222 of file event_bus.hpp.
|
inlinenoexcept |
Capacity of the Tier-2 MPMC ring (power-of-two, set by EventBusOptions).
Definition at line 244 of file event_bus.hpp.
|
inlinenoexcept |
Approximate number of batches currently in the Tier-2 ring.
Definition at line 242 of file event_bus.hpp.