Expand description
State Management for Stream Processing
Provides stateful operators with persistence, checkpointing, and recovery capabilities. Essential for production streaming applications that need fault tolerance.
§Features
- Stateful Operators: Maintain state across events (counters, aggregations, etc.)
- Checkpointing: Periodic state snapshots for fault tolerance
- Recovery: Restore state after failures
- Multiple Backends: Memory, File, and extensible to RocksDB/Redis
- TTL Support: Automatic state expiration
§Example
ⓘ
use rust_rule_engine::streaming::state::*;
// Create state store
let mut state = StateStore::new(StateBackend::Memory);
// Store and retrieve state
state.put("user_count", Value::Integer(42))?;
let count = state.get("user_count")?;
// Checkpoint for fault tolerance
state.checkpoint("checkpoint_1")?;Structs§
- Checkpoint
Metadata - Metadata about a checkpoint
- State
Config - Configuration for state management
- State
Statistics - Statistics about state store
- State
Store - Main state store for managing stateful operations
- Stateful
Operator - Stateful operator that maintains state across events
Enums§
- State
Backend - Backend type for state storage
Type Aliases§
- State
Result - Result type for state operations