pub struct CircuitBreakerRegistry { /* private fields */ }Expand description
A registry of circuit breakers keyed by model name.
New entries are created lazily with the supplied default configuration.
Implementations§
Source§impl CircuitBreakerRegistry
impl CircuitBreakerRegistry
Sourcepub fn new(default_config: CircuitBreakerConfig) -> Self
pub fn new(default_config: CircuitBreakerConfig) -> Self
Create a registry; new breakers will be created with default_config.
Sourcepub fn get(&self, model: &str) -> Arc<CircuitBreaker> ⓘ
pub fn get(&self, model: &str) -> Arc<CircuitBreaker> ⓘ
Get (or lazily create) the circuit breaker for model.
Sourcepub fn register(&self, model: String, config: CircuitBreakerConfig)
pub fn register(&self, model: String, config: CircuitBreakerConfig)
Register a circuit breaker for model with a specific configuration.
Auto Trait Implementations§
impl !RefUnwindSafe for CircuitBreakerRegistry
impl Freeze for CircuitBreakerRegistry
impl Send for CircuitBreakerRegistry
impl Sync for CircuitBreakerRegistry
impl Unpin for CircuitBreakerRegistry
impl UnsafeUnpin for CircuitBreakerRegistry
impl UnwindSafe for CircuitBreakerRegistry
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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request