public class ResultFuture<T> extends Object
| 构造器和说明 |
|---|
ResultFuture(Class<T> type) |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
add(Long id,
ResultFuture<?> future)
添加future
|
static void |
complete(Response response)
完成CompletableFuture
|
static <T> ResultFuture<T> |
future()
获取ThreadLocal中的future并清除
|
T |
get()
获取结果
|
T |
get(long timeout,
TimeUnit unit)
获取结果
|
void |
local()
保存到ThreadLocal中
|
static void |
remove(Long id)
删除
|
public static void add(Long id, ResultFuture<?> future)
id - 请求idfuture - CompletableFuturepublic static void complete(Response response)
response - 响应public static void remove(Long id)
id - 请求idpublic static <T> ResultFuture<T> future()
T - 返回结果类型public void local()
Copyright © 2021. All rights reserved.