pub struct Reactor { /* private fields */ }Expand description
The main reactor for event processing
Implementations§
Source§impl Reactor
impl Reactor
Sourcepub fn new(config: ReactorConfig) -> Result<Self, ReactorError>
pub fn new(config: ReactorConfig) -> Result<Self, ReactorError>
Creates a new reactor with the given configuration
§Errors
Currently does not return any errors, but may in the future if initialization fails
Sourcepub fn add_operator(&mut self, operator: Box<dyn Operator>)
pub fn add_operator(&mut self, operator: Box<dyn Operator>)
Register an operator in the processing chain
Sourcepub fn shutdown_handle(&self) -> Arc<AtomicBool>
pub fn shutdown_handle(&self) -> Arc<AtomicBool>
Get a handle to the shutdown flag
Sourcepub fn submit(&mut self, event: Event) -> Result<(), ReactorError>
pub fn submit(&mut self, event: Event) -> Result<(), ReactorError>
Submit an event for processing
§Errors
Returns ReactorError::QueueFull if the event queue is at capacity
Sourcepub fn submit_batch(&mut self, events: Vec<Event>) -> Result<(), ReactorError>
pub fn submit_batch(&mut self, events: Vec<Event>) -> Result<(), ReactorError>
Submit multiple events for processing
§Errors
Returns ReactorError::QueueFull if there’s insufficient capacity for all events
Sourcepub fn poll(&mut self) -> Vec<Output>
pub fn poll(&mut self) -> Vec<Output>
Run one iteration of the event loop Returns outputs ready for downstream
Sourcepub fn advance_watermark(&mut self, timestamp: i64)
pub fn advance_watermark(&mut self, timestamp: i64)
Advances the watermark to the given timestamp.
Called when an external watermark message arrives (e.g., from TPC coordination).
Updates the reactor’s event time tracking and watermark generator state.
Any resulting watermark output will be included in the next poll() result.
Sourcepub fn trigger_checkpoint(&mut self) -> Vec<OperatorState>
pub fn trigger_checkpoint(&mut self) -> Vec<OperatorState>
Triggers a checkpoint by snapshotting all operator states.
Called when a CheckpointRequest arrives from the control plane.
Collects the serialized state from each operator and returns it
for persistence by Ring 1.
Sourcepub fn events_processed(&self) -> u64
pub fn events_processed(&self) -> u64
Get the number of events processed
Sourcepub fn queue_size(&self) -> usize
pub fn queue_size(&self) -> usize
Get the number of events in the queue
Sourcepub fn set_cpu_affinity(&self) -> Result<(), ReactorError>
pub fn set_cpu_affinity(&self) -> Result<(), ReactorError>
Set CPU affinity if configured
§Errors
Returns ReactorError if CPU affinity cannot be set (platform-specific)
Auto Trait Implementations§
impl Freeze for Reactor
impl !RefUnwindSafe for Reactor
impl Send for Reactor
impl !Sync for Reactor
impl Unpin for Reactor
impl !UnwindSafe for Reactor
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.