pub struct CircuitBreakerBuilder { /* private fields */ }Expand description
Builder for CircuitBreakerInterceptor.
§Example
use rtci_interceptor::{CircuitBreakerBuilder, Registry, Slot};
let (breaker, handle) = CircuitBreakerBuilder::new().build();
let chain = Registry::new().with(Slot::CircuitBreaker, breaker).build();
assert!(handle.ceased().is_empty());Implementations§
Source§impl CircuitBreakerBuilder
impl CircuitBreakerBuilder
Sourcepub fn with_rtcp_interval(self, interval: Duration) -> Self
pub fn with_rtcp_interval(self, interval: Duration) -> Self
Td, this endpoint’s deterministic RTCP reporting interval, computed with Tmin = 5 s (section 4.1). The RTCP timeout breaker trips after three of them. Values above 5 s are held to 5 s: the RFC says not to configure a longer one.
Sourcepub fn with_t_rr_interval(self, interval: Duration) -> Self
pub fn with_t_rr_interval(self, interval: Duration) -> Self
The AVPF T_rr_interval in use, which replaces Tdr in CB_INTERVAL when it is larger
(section 4.3). Held to 4 s (sections 4.1 and 4.3).
Sourcepub fn with_non_reporting_threshold(self, k: u32) -> Self
pub fn with_non_reporting_threshold(self, k: u32) -> Self
k, the number of reports without progress that gives assurance the forward path failed (section 4.2). 5 is recommended.
Sourcepub fn with_frame_group_size(self, frames: u32) -> Self
pub fn with_frame_group_size(self, frames: u32) -> Self
G, the number of frames the codec needs before it can change rate (section 3). 1 for a codec that can adapt on every frame.
Sourcepub fn with_full_tcp_equation(self, full: bool) -> Self
pub fn with_full_tcp_equation(self, full: bool) -> Self
Use the full TCP throughput equation instead of the simplified one (section 4.3: MAY; it is more sensitive to loss and trips earlier).
Sourcepub fn with_packet_size(self, packet_size: PacketSize) -> Self
pub fn with_packet_size(self, packet_size: PacketSize) -> Self
How s, the packet size of the TCP throughput equation, is taken (section 4.3).
PacketSize::SendingWindow by default; PacketSize::LastFrames is section 3’s
“last 4 * G frames”.
Sourcepub fn with_rate_reduction(self, reduce: bool) -> Self
pub fn with_rate_reduction(self, reduce: bool) -> Self
When the congestion breaker trips, first ask for a tenth of the rate
(CircuitBreakerState::Reduced) instead of ceasing at once (section 4.3: MAY). If it
trips again after the next CB_INTERVAL reports the flow ceases.
Sourcepub fn with_grouped_flows(self, group: bool) -> Self
pub fn with_grouped_flows(self, group: bool) -> Self
Treat every flow of the connection as one group: a breaker tripping for one flow applies to all (section 8: MAY). By default each SSRC is judged on its own.
Sourcepub fn with_media_usability(self, usability: MediaUsability) -> Self
pub fn with_media_usability(self, usability: MediaUsability) -> Self
The bound past which the media is unusable (section 4.4). Without one the media usability breaker does not run: the RFC defines no bound.
Sourcepub fn build(self) -> (CircuitBreakerInterceptor, CircuitBreakerHandle)
pub fn build(self) -> (CircuitBreakerInterceptor, CircuitBreakerHandle)
Build the interceptor and the handle the application watches it through.
Sourcepub fn build_with_handle(
self,
handle: &CircuitBreakerHandle,
) -> CircuitBreakerInterceptor
pub fn build_with_handle( self, handle: &CircuitBreakerHandle, ) -> CircuitBreakerInterceptor
Build the interceptor handle watches (made beforehand, for example to give it to the
congestion controller of the same transport). One interceptor per handle.