public class ContextStateFutureImpl<T> extends StateFutureImpl<T>
RecordContext
and maintains the reference count of it. The
reason why we maintain the reference here is that the ContextStateFutureImpl can be created
multiple times since user may chain their code wildly, some of which are only for internal usage
(See StateFutureImpl
). So maintaining reference counting by the lifecycle of state future
is relatively simple and less error-prone.
Reference counting added on RecordContext
follows:
ContextStateFutureImplTest
where the reference counting is carefully
tested.StateFutureImpl.AsyncFrameworkExceptionHandler, StateFutureImpl.CallbackRunner
callbackRunner, exceptionHandler
Modifier and Type | Method and Description |
---|---|
void |
callbackFinished()
Will be triggered when a callback finishes processing.
|
void |
callbackRegistered()
Will be triggered when a callback is registered.
|
<A> StateFutureImpl<A> |
makeNewStateFuture()
Make a new future based on context of this future.
|
void |
postComplete(boolean inCallbackRunner)
Will be triggered when this future completes.
|
complete, completeExceptionally, thenAccept, thenApply, thenCombine, thenCompose, thenSyncAccept
public <A> StateFutureImpl<A> makeNewStateFuture()
StateFutureImpl
makeNewStateFuture
in class StateFutureImpl<T>
public void callbackRegistered()
StateFutureImpl
callbackRegistered
in class StateFutureImpl<T>
public void postComplete(boolean inCallbackRunner)
StateFutureImpl
postComplete
in class StateFutureImpl<T>
public void callbackFinished()
StateFutureImpl
callbackFinished
in class StateFutureImpl<T>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.