map_concurrent()
Map an async function over items with bounded concurrency.
Usage
map_concurrent(
items,
fn,
*,
limit,
on_done=None,
)Parameters
items: Sequence[T]-
The inputs to process.
fn: Callable[[T], Awaitable[R]]-
Async function applied to each item.
limit: int-
Maximum number of in-flight calls.
on_done: Callable[[int], None] | None = None-
Progress callback invoked with
1as each item completes.
Returns
list[R]- The results, in input order.