Sends one round's requests: runs a function on each item, up to
concurrency at once, and returns the results in item order.
Each item runs in a task linked to the caller, so the caller's death stops its requests. Once one fails, by a raise, throw, or exit, or by an exit signal from outside, no further item starts, and the items after it still running are killed at once: an item may send several requests, and a killed one sends no more. The failure reaches the caller once the items before it have answered. Of several failures, the first in item order wins. The exception is an exit signal from outside in a caller that doesn't trap exits: it reaches the caller at once, through the link, and kills it.
The caller's mailbox is left as it was, even when it traps exits.
Summary
Functions
Runs fun on each item, up to concurrency at once, and returns the
results in item order. Fails with the first failure in item order.
Functions
@spec run(Enumerable.t(), pos_integer(), (term() -> term())) :: [term()]
Runs fun on each item, up to concurrency at once, and returns the
results in item order. Fails with the first failure in item order.