public final class Async
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> DeleteRequest<T> |
adapt(DeleteRequest<T> req) |
static <T> FetchRequest<T> |
adapt(FetchRequest<T> req) |
static <T> QueryRequest<T> |
adapt(QueryRequest<T> req) |
static <T> SearchRequest<T> |
adapt(SearchRequest<T> req) |
static <T> play.libs.F.Promise<T> |
asPlayPromise(com.google.common.util.concurrent.ListenableFuture<T> future)
Converts Guava's ListenableFuture to play.libs.F.Promise.
|
static play.libs.F.Promise<play.mvc.Result> |
asyncResult(com.google.common.util.concurrent.ListenableFuture<play.mvc.Result> resultFuture)
Creates Play's AsyncResult based on Guava's ListenableFuture.
|
static <T> T |
await(play.libs.F.Promise<T> promise)
Blocks on a promise.
|
static <T> T |
awaitResult(play.libs.F.Promise<SphereResult<T>> promise)
Blocks, extracts success value, converts Sphere errors to exceptions.
|
static <T> play.libs.F.Promise<SphereResult<T>> |
execute(CommandRequest<T> req)
Executes a CommandRequest.
|
public static play.libs.F.Promise<play.mvc.Result> asyncResult(com.google.common.util.concurrent.ListenableFuture<play.mvc.Result> resultFuture)
resultFuture
- the future to transformpublic static <T> play.libs.F.Promise<T> asPlayPromise(com.google.common.util.concurrent.ListenableFuture<T> future)
public static <T> T await(play.libs.F.Promise<T> promise)
promise
- the promise to blockpublic static <T> T awaitResult(play.libs.F.Promise<SphereResult<T>> promise)
public static <T> play.libs.F.Promise<SphereResult<T>> execute(CommandRequest<T> req)
public static <T> FetchRequest<T> adapt(FetchRequest<T> req)
public static <T> DeleteRequest<T> adapt(DeleteRequest<T> req)
public static <T> QueryRequest<T> adapt(QueryRequest<T> req)
public static <T> SearchRequest<T> adapt(SearchRequest<T> req)