Skip to main content

build_connection_semaphore

Function build_connection_semaphore 

Source
pub fn build_connection_semaphore(
    networking: Option<&AppState>,
    factor: &'static str,
    factor_limit: Option<usize>,
    wait_timeout: Option<Duration>,
) -> ConnectionSemaphore
Expand description

Builds a ConnectionSemaphore for an outbound factor, incorporating the optional global connection limit from the networking factor’s app state.

Emits a warning when the per-factor limit exceeds the global cap (the global limit would be the effective ceiling in that case).

The app identifier is taken from the networking app state (or <unnamed> when networking is absent) and plumbed through to the semaphore so that rejection tracing events can carry tenant attribution without app identity appearing on metric labels.