MCPcopy Index your code
hub / github.com/BoltsFramework/Bolts-Java / call

Method call

Bolts/src/bolts/Task.java:230–242  ·  view source on GitHub ↗

Invokes the callable using the given executor, returning a Task to represent the operation.

(final Callable<TResult> callable, Executor executor)

Source from the content-addressed store, hash-verified

228 * Invokes the callable using the given executor, returning a Task to represent the operation.
229 */
230 public static <TResult> Task<TResult> call(final Callable<TResult> callable, Executor executor) {
231 final Task<TResult>.TaskCompletionSource tcs = Task.<TResult> create();
232 executor.execute(new Runnable() {
233 public void run() {
234 try {
235 tcs.setResult(callable.call());
236 } catch (Exception e) {
237 tcs.setError(e);
238 }
239 }
240 });
241 return tcs.getTask();
242 }
243
244 /**
245 * Invokes the callable on the current thread, producing a Task.

Callers 3

callInBackgroundMethod · 0.95
runMethod · 0.45
thenMethod · 0.45

Calls 3

createMethod · 0.95
executeMethod · 0.80
getTaskMethod · 0.80

Tested by

no test coverage detected