Method Concurrent.fold()
- Method fold
- Futurefold(- array(- Future)- futures,- mixed- initial,- function(- mixed,- mixed,- mixed... :- mixed)- fun,- mixed...- extra)
- Description
- Return a Future that represents the accumulated results of applying - funto the results of the- futuresin turn.
- Parameter initial
- Initial value of the accumulator. 
- Parameter fun
- Function to apply. The first argument is the result of one of the - futures, the second the current accumulated value, and any further from- extra.
- Note
- If - funthrows an error it will fail the Future.
- Note
- funmay be called in any order, and will be called once for every Future in- futures, unless one of calls fails in which case no further calls will be performed.
- Note
- The returned Future does NOT have any state (eg backend) propagated from the - futures. This must be done by hand.