pub struct ResilienceOrchestrator { /* private fields */ }Expand description
Resilience orchestrator combining all patterns
Implementations§
Source§impl ResilienceOrchestrator
impl ResilienceOrchestrator
Sourcepub fn new(retry_policy: RetryPolicy) -> Self
pub fn new(retry_policy: RetryPolicy) -> Self
Create a new resilience orchestrator
Sourcepub async fn GetCircuitBreaker(
&self,
service: &str,
config: CircuitBreakerConfig,
) -> Arc<CircuitBreaker>
pub async fn GetCircuitBreaker( &self, service: &str, config: CircuitBreakerConfig, ) -> Arc<CircuitBreaker>
Get or create circuit breaker with configuration validation
Sourcepub async fn GetBulkhead(
&self,
service: &str,
config: BulkheadConfig,
) -> Arc<BulkheadExecutor>
pub async fn GetBulkhead( &self, service: &str, config: BulkheadConfig, ) -> Arc<BulkheadExecutor>
Get or create bulkhead with configuration validation
Sourcepub async fn GetAllCircuitBreakerStatistics(&self) -> Vec<CircuitStatistics>
pub async fn GetAllCircuitBreakerStatistics(&self) -> Vec<CircuitStatistics>
Get all circuit breaker statistics
Sourcepub async fn GetAllBulkheadStatistics(&self) -> Vec<BulkheadStatistics>
pub async fn GetAllBulkheadStatistics(&self) -> Vec<BulkheadStatistics>
Get all bulkhead statistics
Sourcepub async fn ExecuteResilient<F, R>(
&self,
service: &str,
retry_policy: &RetryPolicy,
circuit_config: CircuitBreakerConfig,
bulkhead_config: BulkheadConfig,
f: F,
) -> Result<R, String>
pub async fn ExecuteResilient<F, R>( &self, service: &str, retry_policy: &RetryPolicy, circuit_config: CircuitBreakerConfig, bulkhead_config: BulkheadConfig, f: F, ) -> Result<R, String>
Execute with full resilience and event publishing
Sourcepub fn ValidateConfigurations(
&self,
_RetryPolicy: &RetryPolicy,
CircuitConfig: &CircuitBreakerConfig,
BulkheadConfig: &BulkheadConfig,
) -> Result<(), String>
pub fn ValidateConfigurations( &self, _RetryPolicy: &RetryPolicy, CircuitConfig: &CircuitBreakerConfig, BulkheadConfig: &BulkheadConfig, ) -> Result<(), String>
Validate all configurations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResilienceOrchestrator
impl !RefUnwindSafe for ResilienceOrchestrator
impl Send for ResilienceOrchestrator
impl Sync for ResilienceOrchestrator
impl Unpin for ResilienceOrchestrator
impl !UnwindSafe for ResilienceOrchestrator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].