MCPcopy Create free account
hub / github.com/traneio/future / flatApply

Method flatApply

future-java/src/main/java/io/trane/future/Future.java:153–153  ·  view source on GitHub ↗

Applies the provided supplier and flattens the result. This method is useful to apply a supplier safely without having to catch possible synchronous exceptions that the supplier may throw. @param s a supplier that may throw an exception @return the future produced by the supplier or a failed f

(final Supplier<Future<T>> s)

Source from the content-addressed store, hash-verified

151 * throws a synchronous exception (not a failed Future)
152 */
153 public static <T> Future<T> flatApply(final Supplier<Future<T>> s) {
154 try {
155 return s.get();
156 } catch (final Throwable ex) {

Callers 2

flatApplyValueMethod · 0.95
flatApplyExceptionMethod · 0.95

Calls

no outgoing calls

Tested by 2

flatApplyValueMethod · 0.76
flatApplyExceptionMethod · 0.76