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

Method flatMap

future-java/src/main/java/io/trane/future/Promise.java:489–500  ·  view source on GitHub ↗
(final Function<? super T, ? extends Future<R>> f)

Source from the content-addressed store, hash-verified

487 }
488
489 @Override
490 public final <R> Future<R> flatMap(final Function<? super T, ? extends Future<R>> f) {
491 if (getInterruptHandler() != null)
492 return continuation(new FlatMap<T, R>(f) {
493 @Override
494 protected final InterruptHandler getInterruptHandler() {
495 return Promise.this;
496 }
497 });
498 else
499 return continuation(new FlatMap<T, R>(f));
500 }
501
502 private static class Transform<T, R> extends Continuation<T, R> {
503 private final Transformer<? super T, ? extends R> t;

Callers 1

flatMapPromiseMethod · 0.95

Calls 2

getInterruptHandlerMethod · 0.95
continuationMethod · 0.95

Tested by

no test coverage detected