Package io.servicetalk.transport.api
Interface ExecutionStrategy
- All Known Subinterfaces:
ConnectExecutionStrategy,GrpcExecutionStrategy,HttpExecutionStrategy
- All Known Implementing Classes:
ConnectAndHttpExecutionStrategy
public interface ExecutionStrategy
An execution strategy for all transports.
Implementations should not override the default Object.equals(Object) and Object.hashCode() method
implementations. Default instance equality and hash-code behavior should be consistent across all instances.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturnstrueif the instance has offloading for any operation.booleanReturnstrueif signals on theCompletablereturned by asynchronous close operations, usuallyListenableAsyncCloseable, are offloaded, otherwise false if the signals may not be offloaded.default ExecutionStrategymerge(ExecutionStrategy other) Combines this execution strategy with another execution strategy.static ExecutionStrategyReturns anExecutionStrategythat requires offloading for all actions.static ExecutionStrategyReturns anExecutionStrategythat requires no offloading and is compatible with all other offloading strategies.
-
Method Details
-
hasOffloads
default boolean hasOffloads()Returnstrueif the instance has offloading for any operation.- Returns:
trueif the instance has offloading for any operation.
-
isCloseOffloaded
boolean isCloseOffloaded()Returnstrueif signals on theCompletablereturned by asynchronous close operations, usuallyListenableAsyncCloseable, are offloaded, otherwise false if the signals may not be offloaded.- Returns:
trueif signals on theCompletablereturned by asynchronous close operations are offloaded, otherwise falseif the signals may not be offloaded.
-
offloadNone
Returns anExecutionStrategythat requires no offloading and is compatible with all other offloading strategies.- Returns:
- an
ExecutionStrategythat requires no offloading.
-
offloadAll
Returns anExecutionStrategythat requires offloading for all actions.- Returns:
- an
ExecutionStrategythat requires offloading.
-
merge
Combines this execution strategy with another execution strategy.- Parameters:
other- The other execution strategy to combine.- Returns:
- The combined execution strategy.
-