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

Method async

future-java/src/main/java/io/trane/future/FuturePool.java:69–77  ·  view source on GitHub ↗

Isolates the execution of the supplier on this future pool. @param s the supplier. @return a future with the result of the supplier.

(final Supplier<T> s)

Source from the content-addressed store, hash-verified

67 * @return a future with the result of the supplier.
68 */
69 public final <T> Future<T> async(final Supplier<T> s) {
70 try {
71 final AsyncPromise<T> p = new AsyncPromise<>(s);
72 executor.submit(p);
73 return p;
74 } catch (final RejectedExecutionException ex) {
75 return Future.exception(ex);
76 }
77 }
78}
79
80final class AsyncPromise<T> extends Promise<T> implements Runnable {

Callers 4

asyncMethod · 0.95
asyncFailureMethod · 0.95
asyncRejectedMethod · 0.95
isolateMethod · 0.95

Calls 2

exceptionMethod · 0.95
submitMethod · 0.45

Tested by 3

asyncMethod · 0.76
asyncFailureMethod · 0.76
asyncRejectedMethod · 0.76