pub struct RuntimeConfig {
pub id: String,
pub index_factory: Arc<IndexFactory>,
pub state_store_provider: Arc<dyn StateStoreProvider>,
pub queries: Vec<QueryConfig>,
}Expand description
Runtime configuration with applied defaults
RuntimeConfig represents a fully-resolved configuration with all global defaults
applied to individual components. It’s created from DrasiLibConfig
and used internally by DrasiLib for execution.
§Plugin Architecture
Important: drasi-lib has ZERO awareness of which plugins exist. Sources and
reactions are passed as owned instances via add_source() and add_reaction().
Only queries are stored in RuntimeConfig.
§Default Application
When converting from DrasiLibConfig to RuntimeConfig, global capacity
settings are applied to queries that don’t specify their own values:
- priority_queue_capacity: Applied to queries (default: 10000)
- dispatch_buffer_capacity: Applied to queries (default: 1000)
§Examples
id: my-server
priority_queue_capacity: 50000 # Global default
queries:
- id: q1
query: "MATCH (n) RETURN n"
source_subscriptions:
- source_id: s1
# priority_queue_capacity will be 50000 (inherited)
- id: q2
query: "MATCH (m) RETURN m"
source_subscriptions:
- source_id: s1
priority_queue_capacity: 100000 # Override globalFields§
§id: StringUnique identifier for this DrasiLib instance
index_factory: Arc<IndexFactory>Index factory for creating storage backend indexes for queries
state_store_provider: Arc<dyn StateStoreProvider>State store provider for plugin state persistence
queries: Vec<QueryConfig>Query configurations (sources/reactions are now instance-only)
Implementations§
Source§impl RuntimeConfig
impl RuntimeConfig
Sourcepub fn new(
config: DrasiLibConfig,
index_provider: Option<Arc<dyn IndexBackendPlugin>>,
state_store_provider: Option<Arc<dyn StateStoreProvider>>,
) -> Self
pub fn new( config: DrasiLibConfig, index_provider: Option<Arc<dyn IndexBackendPlugin>>, state_store_provider: Option<Arc<dyn StateStoreProvider>>, ) -> Self
Create a new RuntimeConfig with optional index backend and state store providers.
When an index provider is supplied, RocksDB and Redis/Garnet storage backends will delegate to the provider for index creation. Without a provider, only in-memory storage backends can be used.
When a state store provider is supplied, it will be used for plugin state persistence. Without a provider, the default in-memory state store is used.
§Arguments
config- The DrasiLib configurationindex_provider- Optional index backend plugin for persistent storagestate_store_provider- Optional state store provider for plugin state
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§fn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more