public class DefaultFuture extends CompletableFuture<Object>
CompletableFuture.AsynchronousCompletionTask| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel() |
boolean |
cancel(boolean mayInterruptIfRunning) |
static void |
closeChannel(Channel channel)
close a channel when a channel is inactive
directly return the unfinished requests.
|
static void |
destroy() |
ExecutorService |
getExecutor() |
static DefaultFuture |
getFuture(long id) |
Request |
getRequest() |
static boolean |
hasFuture(Channel channel) |
static DefaultFuture |
newFuture(Channel channel,
Request request,
int timeout,
ExecutorService executor)
init a DefaultFuture
1.init a DefaultFuture
2.timeout check
|
static void |
received(Channel channel,
Response response) |
static void |
received(Channel channel,
Response response,
boolean timeout) |
static void |
sent(Channel channel,
Request request) |
void |
setExecutor(ExecutorService executor) |
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completedFuture, completeExceptionally, exceptionally, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, obtrudeException, obtrudeValue, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsyncpublic ExecutorService getExecutor()
public void setExecutor(ExecutorService executor)
public static void destroy()
public static DefaultFuture newFuture(Channel channel, Request request, int timeout, ExecutorService executor)
channel - channelrequest - the requesttimeout - timeoutpublic static DefaultFuture getFuture(long id)
public static boolean hasFuture(Channel channel)
public static void closeChannel(Channel channel)
channel - channel to closepublic boolean cancel(boolean mayInterruptIfRunning)
public void cancel()
public Request getRequest()
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.