このreduceSuccessがFutureとしてのモナディックなreduceで for (index, future) in futures.enumerated() { if future.eventLoop.inEventLoop, let result = future._value { // Fast-track already-fulfilled results without the overhead of calling `whenComplete`. This can yield a // ~20% performance improvement in the case of large arrays where all elements are already fulfilled. processResult(index, result) if case .failure = result { return // Once the promise is failed, future results do not need to be processed. } } else { future.hop(to: eventLoop) .whenComplete { result in processResult(index, result) } } }