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 boolean
Returnstrue
if the instance has offloading for any operation.boolean
Returnstrue
if signals on theCompletable
returned by asynchronous close operations, usuallyListenableAsyncCloseable
, are offloaded, otherwise false if the signals may not be offloaded.default ExecutionStrategy
merge
(ExecutionStrategy other) Combines this execution strategy with another execution strategy.static ExecutionStrategy
Returns anExecutionStrategy
that requires offloading for all actions.static ExecutionStrategy
Returns anExecutionStrategy
that requires no offloading and is compatible with all other offloading strategies.
-
Method Details
-
hasOffloads
default boolean hasOffloads()Returnstrue
if the instance has offloading for any operation.- Returns:
true
if the instance has offloading for any operation.
-
isCloseOffloaded
boolean isCloseOffloaded()Returnstrue
if signals on theCompletable
returned by asynchronous close operations, usuallyListenableAsyncCloseable
, are offloaded, otherwise false if the signals may not be offloaded.- Returns:
true
if signals on theCompletable
returned by asynchronous close operations are offloaded, otherwise falseif the signals may not be offloaded.
-
offloadNone
Returns anExecutionStrategy
that requires no offloading and is compatible with all other offloading strategies.- Returns:
- an
ExecutionStrategy
that requires no offloading.
-
offloadAll
Returns anExecutionStrategy
that requires offloading for all actions.- Returns:
- an
ExecutionStrategy
that requires offloading.
-
merge
Combines this execution strategy with another execution strategy.- Parameters:
other
- The other execution strategy to combine.- Returns:
- The combined execution strategy.
-