Module streaming

Module streaming 

Source
Expand description

Streaming rule engine for real-time event processing Rule Streaming Engine - Real-time Event Processing

This module provides real-time rule execution capabilities for streaming data, including time-based windows, event aggregation, and continuous rule evaluation.

§Features

  • 🔄 Continuous Processing: Non-stop rule evaluation on incoming events
  • ⏰ Time Windows: Sliding and tumbling window aggregations
  • 📊 Stream Analytics: Count, sum, average, min/max over time windows
  • 🎯 Event Filtering: Pattern matching and event correlation
  • ⚡ High Throughput: Async processing with backpressure handling

§Example

use rust_rule_engine::streaming::*;

let mut stream_engine = StreamRuleEngine::new()
    .with_window_size(Duration::from_secs(60))
    .with_buffer_size(1000);

// Define streaming rule
let rule = r#"
rule "HighFrequencyTrading" {
    when
        stream(TradeEvent, 5s).count() > 100
    then
        AlertService.trigger("High frequency detected");
}
"#;

stream_engine.add_rule(rule).await?;
stream_engine.start().await?;

Re-exports§

pub use aggregator::AggregationType;
pub use aggregator::Aggregator;
pub use engine::StreamRuleEngine;
pub use event::EventMetadata;
pub use event::StreamEvent;
pub use window::TimeWindow;
pub use window::WindowManager;
pub use window::WindowType;

Modules§

aggregator
Stream Aggregation Functions
engine
Streaming Rule Engine
event
Stream Event Types and Metadata
window
Time Window Management for Stream Processing