/** * Executes the given action with the promise value, on a blocking thread. * <p> * Similar to {@link #blockingMap(Function)}, but does not provide a new value. * This can be used to do something with the value, without terminating the promise. * * @param action the action to to perform with the value, on a blocking thread * @return a promise for the same value given to the action */ default Promise<T> blockingOp(Action<? super T> action) { return flatMap(t -> Blocking.op(action.curry(t)).map(() -> t)); }
return ParallelBatch.of(resultPromises) .forEach((i, result) -> results.put(result.right, result.left)) .map(() -> new HealthCheckResults(ImmutableSortedMap.copyOf(results))); });