vertx.effect.exp.Triple 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.Tuple3;
import vertx.effect.Val;
import vertx.effect.core.AbstractVal;
import static java.util.Objects.requireNonNull;
public abstract class Triple extends AbstractVal> {
public static Triple parallel(final Val _1,
final Val _2,
final Val _3) {
return new ParallelTriple<>(requireNonNull(_1),
requireNonNull(_2),
requireNonNull(_3)
);
}
public static Triple sequential(final Val _1,
final Val _2,
final Val _3) {
return new SequentialTriple(requireNonNull(_1),
requireNonNull(_2),
requireNonNull(_3)
);
}
public abstract Val _1();
public abstract Val _2();
public abstract Val _3();
public static Val race(final Triple triple) {
if (triple == null)
return Cons.failure(new IllegalArgumentException("Triple.race: pair is null"));
return ListExp.parallel(triple._1(),
triple._2(),
triple._3()
)
.race();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy