vertx.effect.exp.ParallelMapExp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-effect Show documentation
Show all versions of vertx-effect Show documentation
When actors meet Functional Programming
package vertx.effect.exp;
import io.vavr.Tuple2;
import io.vavr.collection.List;
import io.vertx.core.CompositeFuture;
import io.vertx.core.Future;
import vertx.effect.RetryPolicy;
import vertx.effect.Val;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Predicate;
import static java.util.Objects.requireNonNull;
/**
Represents a supplier of a vertx future which result is a json object. It has the same
recursive structure as a json object. Each key has a future associated that it's
executed asynchronously. When all the futures are completed, all the results are combined into
a json object.
*/
final class ParallelMapExp extends MapExp {
@SuppressWarnings({"rawtypes"})
public static final ParallelMapExp EMPTY = new ParallelMapExp<>();
ParallelMapExp() {
}
ParallelMapExp(final io.vavr.collection.Map> bindings) {
this.bindings = requireNonNull(bindings);
}
/**
returns a new object future inserting the given future at the given key
@param key the given key
@param exp the given future
@return a new JsObjFuture
*/
@Override
public ParallelMapExp set(final String key,
final Val extends O> exp
) {
return new ParallelMapExp<>(bindings.put(requireNonNull(key),
requireNonNull(exp)
));
}
@Override
public Val
© 2015 - 2025 Weber Informatics LLC | Privacy Policy