Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public void runAsyncWorkersWithFutureReturnType() throws Exception
{" start of returning async worker");
Future<String> future = asyncWorkerReturn.execute();
String result = (String) this.getResultOfFuture(future);" returned result is [" + result + "] ");
private Object getResultOfFuture(Future future) throws Exception
if (future.isDone()) {
return future.get();
}" waiting for result ");
return getResultOfFuture(future);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment