Skip to main content

map_bounded_with

Function map_bounded_with 

Source
pub async fn map_bounded_with<T, R, F, Fut, P>(
    items: Vec<T>,
    limit: usize,
    work: F,
    is_failure: P,
) -> Vec<IndexedResult<R>>
where T: Send + 'static, R: Send + 'static, F: Fn(T) -> Fut + Send + Sync + 'static, Fut: Future<Output = R> + Send + 'static, P: Fn(&R) -> bool + Send + Sync + 'static,
Expand description

Bounded fan-out with optional per-result fail-fast (G-O1).

When is_failure(&result) returns true and fail_fast_enabled, admission stops (same as cooperative cancel). In-flight units drain; never-admitted input indices are not present in the returned vec (callers should pad skipped hosts for agent JSON).

Also respects crate::signals::should_stop / force abort (G-PAR-39).