pub struct Context {
pub store: HashMap<String, VirtualValue>,
pub event_bus: Arc<EventBus>,
pub run_id: String,
pub execution_order: Vec<String>,
pub graph_info: GraphInfo,
pub remote_executor: Option<Arc<dyn RemoteExecutor>>,
pub data_store: Option<Arc<dyn DataStore>>,
pub spill_threshold: usize,
}Expand description
Execution context passed to filters during runtime.
Node outputs are stored as VirtualValues — they may be materialized
in memory, cached on disk, or deferred (not yet computed). The executor
resolves them on demand when a downstream node needs the data.
Fields§
§store: HashMap<String, VirtualValue>Node outputs as virtual values (may be lazy).
event_bus: Arc<EventBus>Event bus for emitting runtime events.
run_id: StringCurrent run ID.
execution_order: Vec<String>Track execution order.
graph_info: GraphInfoGraph topology for input resolution.
remote_executor: Option<Arc<dyn RemoteExecutor>>Optional remote executor for distributed plans.
data_store: Option<Arc<dyn DataStore>>Optional data store for persisting intermediate results.
spill_threshold: usizeMinimum value size (bytes) to spill to DataStore instead of keeping in memory. Default: 0 (disabled — all values stay in memory).
Implementations§
Source§impl Context
impl Context
pub fn new(event_bus: Arc<EventBus>, run_id: impl Into<String>) -> Self
pub fn with_graph_info(self, info: GraphInfo) -> Self
pub fn with_remote_executor(self, executor: Arc<dyn RemoteExecutor>) -> Self
pub fn with_data_store(self, store: Arc<dyn DataStore>) -> Self
Sourcepub fn with_spill_threshold(self, bytes: usize) -> Self
pub fn with_spill_threshold(self, bytes: usize) -> Self
Set spill threshold: values larger than this (in bytes) are offloaded
to the DataStore and replaced with a VirtualValue::Cached reference.
Requires a DataStore to be set via with_data_store().
Sourcepub fn get(&self, node_id: &str) -> Option<&Value>
pub fn get(&self, node_id: &str) -> Option<&Value>
Get the materialized Value for a node, if present and materialized.
Sourcepub fn get_virtual(&self, node_id: &str) -> Option<&VirtualValue>
pub fn get_virtual(&self, node_id: &str) -> Option<&VirtualValue>
Get the raw VirtualValue for a node.
Sourcepub fn set(&mut self, node_id: impl Into<String>, value: Value)
pub fn set(&mut self, node_id: impl Into<String>, value: Value)
Store a materialized value for a node.
Sourcepub fn set_virtual(&mut self, node_id: impl Into<String>, vv: VirtualValue)
pub fn set_virtual(&mut self, node_id: impl Into<String>, vv: VirtualValue)
Store a virtual value (which may be deferred or cached).