Package com.linecorp.armeria.common.util
Class EventLoopCheckingFuture<T>
java.lang.Object
java.util.concurrent.CompletableFuture<T>
com.linecorp.armeria.common.util.EventLoopCheckingFuture<T>
- All Implemented Interfaces:
CompletionStage<T>
,Future<T>
- Direct Known Subclasses:
CompletableRpcResponse
,ThriftFuture
,UnmodifiableFuture
public class EventLoopCheckingFuture<T> extends CompletableFuture<T>
A
CompletableFuture
that warns the user if they call a method that blocks the event loop.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
Constructor Summary
Constructors Constructor Description EventLoopCheckingFuture()
-
Method Summary
Modifier and Type Method Description static <U> EventLoopCheckingFuture<U>
completedFuture(U value)
Returns anEventLoopCheckingFuture
which has been completed with the specifiedvalue
.static <U> EventLoopCheckingFuture<U>
exceptionallyCompletedFuture(Throwable cause)
Returns anEventLoopCheckingFuture
which has been completed exceptionally with the specifiedThrowable
.T
get()
T
get(long timeout, TimeUnit unit)
T
join()
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, failedFuture, failedStage, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, 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, whenCompleteAsync
-
Constructor Details
-
EventLoopCheckingFuture
public EventLoopCheckingFuture()
-
-
Method Details
-
completedFuture
Returns anEventLoopCheckingFuture
which has been completed with the specifiedvalue
. -
exceptionallyCompletedFuture
Returns anEventLoopCheckingFuture
which has been completed exceptionally with the specifiedThrowable
. -
get
- Specified by:
get
in interfaceFuture<T>
- Overrides:
get
in classCompletableFuture<T>
- Throws:
InterruptedException
ExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException- Specified by:
get
in interfaceFuture<T>
- Overrides:
get
in classCompletableFuture<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
join
- Overrides:
join
in classCompletableFuture<T>
-