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
impl RuntimeBuilder
Sourcepub fn max_feeds(self, max: usize) -> Self
pub fn max_feeds(self, max: usize) -> Self
Set the maximum number of concurrent feeds. Default: 64.
Sourcepub fn health_capacity(self, cap: usize) -> Self
pub fn health_capacity(self, cap: usize) -> Self
Set the health broadcast channel capacity. Default: 256.
Sourcepub fn output_capacity(self, cap: usize) -> Self
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.
Sourcepub fn ingress_factory(self, factory: Box<dyn MediaIngressFactory>) -> Self
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.
Sourcepub fn feed_join_timeout(self, timeout: Duration) -> Self
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.
Sourcepub fn coordinator_join_timeout(self, timeout: Duration) -> Self
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.
Sourcepub fn custom_pipeline_policy(self, policy: CustomPipelinePolicy) -> Self
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).
Auto Trait Implementations§
impl Freeze for RuntimeBuilder
impl !RefUnwindSafe for RuntimeBuilder
impl Send for RuntimeBuilder
impl Sync for RuntimeBuilder
impl Unpin for RuntimeBuilder
impl UnsafeUnpin for RuntimeBuilder
impl !UnwindSafe for RuntimeBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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