Constructor and Description |
---|
DefaultFutures(play.api.libs.concurrent.Futures delegate) |
Modifier and Type | Method and Description |
---|---|
<A> java.util.concurrent.CompletionStage<A> |
delayed(java.util.concurrent.CompletionStage<A> stage,
java.time.Duration duration)
Create a CompletionStage which, after a delay, will be redeemed with the result of a
given supplier.
|
<A> java.util.concurrent.CompletionStage<A> |
delayed(java.util.concurrent.CompletionStage<A> stage,
long amount,
java.util.concurrent.TimeUnit unit)
Create a CompletionStage which, after a delay, will be redeemed with the result of a
given supplier.
|
<A> java.util.concurrent.CompletionStage<A> |
timeout(java.util.concurrent.CompletionStage<A> stage,
java.time.Duration duration)
An alias for futures(stage, delay, unit) that uses a java.time.Duration.
|
<A> java.util.concurrent.CompletionStage<A> |
timeout(java.util.concurrent.CompletionStage<A> stage,
long amount,
java.util.concurrent.TimeUnit unit)
Creates a CompletionStage that returns either the input stage, or a futures.
|
@Inject public DefaultFutures(play.api.libs.concurrent.Futures delegate)
public <A> java.util.concurrent.CompletionStage<A> timeout(java.util.concurrent.CompletionStage<A> stage, long amount, java.util.concurrent.TimeUnit unit)
timeout
in interface Futures
A
- the completion's result type.stage
- the input completion stage that may time out.amount
- The amount (expressed with the corresponding unit).unit
- The time Unit.public <A> java.util.concurrent.CompletionStage<A> timeout(java.util.concurrent.CompletionStage<A> stage, java.time.Duration duration)
timeout
in interface Futures
A
- the completion stage that should be wrapped with a future.stage
- the input completion stage that may time out.duration
- The duration after which there is a timeout.public <A> java.util.concurrent.CompletionStage<A> delayed(java.util.concurrent.CompletionStage<A> stage, long amount, java.util.concurrent.TimeUnit unit)
public <A> java.util.concurrent.CompletionStage<A> delayed(java.util.concurrent.CompletionStage<A> stage, java.time.Duration duration)