Skip to main content
1

🏎️ Throughput Priority (Unordered)

runWithLimit(int limit)
Future<List<T>>

limit
int
required
The maximum number of Futures to run simultaneously.
Executes multiple Futures concurrently with a maximum limit. When one finishes, the next is immediately launched.
// Runs 2 at a time. If fetch2 finishes before fetch1,
// results will be [result2, result1, ...].
final results = await futures.runWithLimit(2);
The results are ordered by completion time and are not guaranteed to match the input iterable’s order. Prioritize this for maximum speed.
2

✍️ Order Preservation

runWithLimitOrdered(int limit)
Future<List<T>>

limit
int
required
The maximum number of Futures to run simultaneously.
Executes multiple Futures concurrently while guaranteeing the final list order matches the original input iterable’s index.
// Final result order is always [result1, result2, result3].
final orderedResults = await futures.runWithLimitOrdered(2);
This requires slightly more internal complexity to manage the results, making it marginally slower but ensuring index reliability.