pub struct QueueRouter { /* private fields */ }Expand description
Registry for named queue backends (multi-backend hosts).
Implementations§
Source§impl QueueRouter
impl QueueRouter
Sourcepub fn new() -> QueueRouter
pub fn new() -> QueueRouter
Empty registry.
Sourcepub fn with_default(backend: Arc<dyn QueueBackend>) -> QueueRouter
pub fn with_default(backend: Arc<dyn QueueBackend>) -> QueueRouter
Register a single default backend under DEFAULT_BACKEND_NAME.
Sourcepub fn register(&mut self, name: &str, backend: Arc<dyn QueueBackend>)
pub fn register(&mut self, name: &str, backend: Arc<dyn QueueBackend>)
Sourcepub fn register_runtime(
&self,
name: &str,
backend: Arc<dyn QueueBackend>,
) -> Result<(), BosonError>
pub fn register_runtime( &self, name: &str, backend: Arc<dyn QueueBackend>, ) -> Result<(), BosonError>
Register after Self::set_global (runtime registration).
§Errors
Returns BosonError::Internal if the lock is poisoned.
Sourcepub fn resolve(&self, name: &str) -> Result<Arc<dyn QueueBackend>, BosonError>
pub fn resolve(&self, name: &str) -> Result<Arc<dyn QueueBackend>, BosonError>
Resolve a backend by logical name.
§Errors
Returns BosonError::Internal if the lock is poisoned,
or BosonError::UnknownBackend when name is not registered.
Sourcepub fn set_global(router: QueueRouter)
pub fn set_global(router: QueueRouter)
Install the process-global router (call once at host boot).
Sourcepub fn global() -> Arc<QueueRouter>
pub fn global() -> Arc<QueueRouter>
Global router (panics if Self::set_global was not called).
§Panics
Panics when Self::set_global was not called before this function.
Sourcepub fn try_global() -> Option<Arc<QueueRouter>>
pub fn try_global() -> Option<Arc<QueueRouter>>
Optional global router.
Trait Implementations§
Source§impl Debug for QueueRouter
impl Debug for QueueRouter
Source§impl Default for QueueRouter
impl Default for QueueRouter
Source§fn default() -> QueueRouter
fn default() -> QueueRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for QueueRouter
impl RefUnwindSafe for QueueRouter
impl Send for QueueRouter
impl Sync for QueueRouter
impl Unpin for QueueRouter
impl UnsafeUnpin for QueueRouter
impl UnwindSafe for QueueRouter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
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 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>
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