public class FutureContext extends Object
CompletableFuture> signature
you do not need to use this class since you will get a Future response directly.
Remember to save the Future reference before making another call using the same thread, otherwise, the current Future will be override by the new one, which means you will lose the chance get the return value.
| 限定符和类型 | 字段和说明 |
|---|---|
static InternalThreadLocal<CompletableFuture<?>> |
futureTL |
| 构造器和说明 |
|---|
FutureContext() |
public static InternalThreadLocal<CompletableFuture<?>> futureTL
public static <T> CompletableFuture<T> getCompletableFuture()
T - public static void setFuture(CompletableFuture<?> future)
future - Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.