Interface AsyncExecutor<REQUEST extends AsyncRequest<?>>
-
- All Known Subinterfaces:
StateExecutor
@Internal public interface AsyncExecutor<REQUEST extends AsyncRequest<?>>
Executor for executing batchAsyncRequest
s.Notice that the owner who create the
AsyncExecutor
is 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 aAsyncRequestContainer
which is used to hold the batchedAsyncRequest
.CompletableFuture<Void>
executeBatchRequests(AsyncRequestContainer<REQUEST> asyncRequestContainer)
Execute a batch of async requests.void
executeRequestSync(REQUEST asyncRequest)
Execute a single async request *synchronously*.boolean
fullyLoaded()
Check if this executor is fully loaded.void
shutdown()
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 aAsyncRequestContainer
which 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.
-
-