Skip to main content

RuntimeConfig

Struct RuntimeConfig 

Source
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 global

Fields§

§id: String

Unique 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

Source

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 configuration
  • index_provider - Optional index backend plugin for persistent storage
  • state_store_provider - Optional state store provider for plugin state

Trait Implementations§

Source§

impl Clone for RuntimeConfig

Source§

fn clone(&self) -> RuntimeConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RuntimeConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<DrasiLibConfig> for RuntimeConfig

Source§

fn from(config: DrasiLibConfig) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more