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
Emits 0 and completes after duration
.
Emits 0 and completes after duration
.
a one-item Observable
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.