Remove timeout from MessageQueueThreadImpl creation

Reviewed By: oli

Differential Revision: D2880630

fb-gh-sync-id: bd31395abc69750f16a6ab32d11c55af3ec985a4
This commit is contained in:
Andrei Coman
2016-01-29 14:11:36 -08:00
committed by facebook-github-bot-5
parent 041fb59146
commit 8a10fc629a
2 changed files with 15 additions and 4 deletions

View File

@@ -91,6 +91,18 @@ public class SimpleSettableFuture<T> implements Future<T> {
return mResult;
}
/**
* Convenience wrapper for {@link #get()} that re-throws get()'s Exceptions as
* RuntimeExceptions.
*/
public @Nullable T getOrThrow() {
try {
return get();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
/**
* Convenience wrapper for {@link #get(long, TimeUnit)} that re-throws get()'s Exceptions as
* RuntimeExceptions.