pub struct EngineBuilder { /* private fields */ }Expand description
Fluent builder for an Engine. Takes plain owned specs instead of a
deserialized config schema, so consumers never adopt stream-center’s TOML.
use arcly_stream::prelude::*;
let engine = Engine::builder()
.max_publishers(1_000)
.application(AppSpec::new("live").broadcast_capacity(8192))
.build();
assert_eq!(engine.list_apps().len(), 1);Implementations§
Source§impl EngineBuilder
impl EngineBuilder
Sourcepub fn max_publishers(self, n: usize) -> Self
pub fn max_publishers(self, n: usize) -> Self
Set the hard cap on concurrent publishing streams.
Sourcepub fn config(self, config: EngineConfig) -> Self
pub fn config(self, config: EngineConfig) -> Self
Replace the whole engine config.
Sourcepub fn application(self, app: AppSpec) -> Self
pub fn application(self, app: AppSpec) -> Self
Register an application.
Sourcepub fn applications(self, apps: impl IntoIterator<Item = AppSpec>) -> Self
pub fn applications(self, apps: impl IntoIterator<Item = AppSpec>) -> Self
Register many applications at once.
Sourcepub fn observer<O: Observer>(self, observer: O) -> Self
pub fn observer<O: Observer>(self, observer: O) -> Self
Install a telemetry observer. Defaults to NoopObserver if unset.
Sourcepub fn observer_arc(self, observer: Arc<dyn Observer>) -> Self
pub fn observer_arc(self, observer: Arc<dyn Observer>) -> Self
Install a pre-shared observer (when the host already holds an Arc).
Sourcepub fn authenticator<A: StreamAuthenticator>(self, auth: A) -> Self
pub fn authenticator<A: StreamAuthenticator>(self, auth: A) -> Self
Install a stream authenticator. Defaults to AllowAll if unset.
Sourcepub fn authenticator_arc(self, auth: Arc<dyn StreamAuthenticator>) -> Self
pub fn authenticator_arc(self, auth: Arc<dyn StreamAuthenticator>) -> Self
Install a pre-shared authenticator (when the host already holds an Arc).
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set the idle timeout after which frame-less streams are reaped.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for EngineBuilder
impl !UnwindSafe for EngineBuilder
impl Freeze for EngineBuilder
impl Send for EngineBuilder
impl Sync for EngineBuilder
impl Unpin for EngineBuilder
impl UnsafeUnpin for EngineBuilder
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
Mutably borrows from an owned value. Read more