Created
October 21, 2016 07:00
-
-
Save pmiddend/81223babefae3e25cd6ace8610383fcc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public CompletableFuture<T> orTimeout(long timeout, TimeUnit unit) { | |
if (unit == null) | |
throw new NullPointerException(); | |
if (result == null) | |
whenComplete(new Canceller(Delayer.delay(new Timeout(this), | |
timeout, unit))); | |
return this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment