Skip to main content

RuntimeBuilder

Struct RuntimeBuilder 

Source
pub struct RuntimeBuilder { /* private fields */ }
Expand description

Builder for constructing a Runtime.

The runtime uses a default media backend unless a custom MediaIngressFactory is supplied via ingress_factory().

§Example

use nv_runtime::Runtime;

let runtime = Runtime::builder()
    .max_feeds(16)
    .build()
    .expect("failed to build runtime");

Implementations§

Source§

impl RuntimeBuilder

Source

pub fn max_feeds(self, max: usize) -> Self

Set the maximum number of concurrent feeds. Default: 64.

Source

pub fn health_capacity(self, cap: usize) -> Self

Set the health broadcast channel capacity. Default: 256.

Source

pub fn output_capacity(self, cap: usize) -> Self

Set the output broadcast channel capacity. Default: 256.

Controls how many OutputEnvelopes the aggregate output subscription channel can buffer before the ring buffer wraps.

When the internal sentinel receiver detects ring-buffer wrap, the runtime emits a global HealthEvent::OutputLagged event carrying the sentinel-observed per-event delta (not cumulative). This indicates channel saturation / backpressure risk — it does not guarantee that any specific external subscriber lost messages.

Source

pub fn ingress_factory(self, factory: Box<dyn MediaIngressFactory>) -> Self

Set a custom MediaIngressFactory.

By default the runtime uses the built-in media backend (DefaultMediaFactory). Replace this for testing or alternative backends.

Source

pub fn feed_join_timeout(self, timeout: Duration) -> Self

Set the maximum time to wait for a feed worker thread to join during shutdown or removal. Default: 10s.

If a feed thread does not finish within this timeout, it is detached and a health event is emitted.

Source

pub fn coordinator_join_timeout(self, timeout: Duration) -> Self

Set the maximum time to wait for a batch coordinator thread to join during shutdown. Default: 10s.

Source

pub fn custom_pipeline_policy(self, policy: CustomPipelinePolicy) -> Self

Set the custom pipeline security policy.

Controls whether SourceSpec::Custom pipeline fragments are accepted. Default: Reject.

Set to AllowTrusted when pipeline strings originate from trusted sources (e.g., hard-coded application code).

Source

pub fn build(self) -> Result<Runtime, NvError>

Build the runtime.

§Errors

Returns ConfigError::InvalidCapacity if health_capacity or output_capacity is zero.

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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<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