Interface AsyncExecutor<REQUEST extends AsyncRequest<?>>
-
- All Known Subinterfaces:
StateExecutor
@Internal public interface AsyncExecutor<REQUEST extends AsyncRequest<?>>Executor for executing batchAsyncRequests.Notice that the owner who create the
AsyncExecutoris responsible for shutting down it when it is no longer in use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AsyncRequestContainer<REQUEST>createRequestContainer()Create aAsyncRequestContainerwhich is used to hold the batchedAsyncRequest.CompletableFuture<Void>executeBatchRequests(AsyncRequestContainer<REQUEST> asyncRequestContainer)Execute a batch of async requests.voidexecuteRequestSync(REQUEST asyncRequest)Execute a single async request *synchronously*.booleanfullyLoaded()Check if this executor is fully loaded.voidshutdown()Shutdown the StateExecutor, and new committed state execution requests will be rejected.
-
-
-
Method Detail
-
executeBatchRequests
CompletableFuture<Void> executeBatchRequests(AsyncRequestContainer<REQUEST> asyncRequestContainer)
Execute a batch of async requests.- Parameters:
asyncRequestContainer- The AsyncRequestContainer which holds the given batch of processing requests.- Returns:
- A future can determine whether execution has completed.
-
createRequestContainer
AsyncRequestContainer<REQUEST> createRequestContainer()
Create aAsyncRequestContainerwhich is used to hold the batchedAsyncRequest.
-
executeRequestSync
void executeRequestSync(REQUEST asyncRequest)
Execute a single async request *synchronously*. This is for synchronous APIs.- Parameters:
asyncRequest- the request to run.
-
fullyLoaded
boolean fullyLoaded()
Check if this executor is fully loaded. Will be invoked to determine whether to give more requests to run or wait for a while.- Returns:
- the count.
-
shutdown
void shutdown()
Shutdown the StateExecutor, and new committed state execution requests will be rejected.
-
-