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

Method apply

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

Creates a future with the result of the supplier. Note that the supplier is executed by the current thread. Use FuturePool.async to execute the supplier on a separate thread. @param s a supplier that may throw an exception @param the type of the value returned by the Supplier. @return a

(final Supplier<T> s)

Source from the content-addressed store, hash-verified

134 * the supplier exception.
135 */
136 public static <T> Future<T> apply(final Supplier<T> s) {
137 try {
138 return new ValueFuture<>(s.get());
139 } catch (final Throwable ex) {

Callers 11

applyValueMethod · 0.95
applyExceptionMethod · 0.95
whileDoMethod · 0.95
biFlatMapExceptionMethod · 0.95
createMethod · 0.65
flushMethod · 0.65
rescueMethod · 0.65
mapMethod · 0.65
flatMapMethod · 0.65
biMapMethod · 0.65
biFlatMapMethod · 0.65

Calls

no outgoing calls

Tested by 4

applyValueMethod · 0.76
applyExceptionMethod · 0.76
whileDoMethod · 0.76
biFlatMapExceptionMethod · 0.76