Runs code
after duration
.
Runs code
after duration
. The returned Future contains the successful result of code
or is completed with
any failure it might throw.
type of successful result
delay after which to run code
code to run
a Future of the result of running code
or completed with any failure that it might throw
Emits 0L and completes after duration
.
Emits 0L and completes after duration
.
a one-item Observable
Applies test
to each element of in
and returns the first element that completes the test successfully along
with its result.
Applies test
to each element of in
and returns the first element that completes the test successfully along
with its result.
If all tests fail, the returned Future fails with a NoSuchElementException. Failures of individual Futures are ignored.
type of element
type of result
elements under test
the test
the element that first successfully completes the test along with its test result
Constructs a future that is completed according to keepPromise
.
Constructs a future that is completed according to keepPromise
. This pattern
can be used to convert callback-based APIs to Future-based ones. For example,
parameter keepPromise
can call some callback-based API, and the callback
implementation can complete the supplied promise.
type of value to complete promise with
code that completes the promise
the future completion value
type of promise
timeout
a Promise that fails with a TimeoutException after duration
has passed unless completed by then
Fails f
with a TimeoutException unless it's completed within timeout
.
Fails f
with a TimeoutException unless it's completed within timeout
.
type of result
duration
future computation to wrap in a timeout
a future which may time out
This method blocks a thread until dur
has passed, but does not block the caller thread.
This method blocks a thread until dur
has passed, but does not block the caller thread.
length of duration
a Future that completes successfully after dur
has passed
Use delay2(Duration)
instead.