Package io.servicetalk.transport.api
Interface ConnectExecutionStrategy
- All Superinterfaces:
ExecutionStrategy
- All Known Implementing Classes:
ConnectAndHttpExecutionStrategy
An execution strategy for creating or accepting connections.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectExecutionStrategy
from
(ExecutionStrategy executionStrategy) Converts the provided execution strategy to aConnectExecutionStrategy
.default boolean
Returnstrue
if the instance has offloading for any operation.boolean
Returns true if connection creation or accept requires offloading.default ConnectExecutionStrategy
merge
(ExecutionStrategy other) Combines this execution strategy with another execution strategy.static ConnectExecutionStrategy
Returns anConnectExecutionStrategy
that requires offloading for all actions.static ConnectExecutionStrategy
Returns anConnectExecutionStrategy
that requires no offloading.Methods inherited from interface io.servicetalk.transport.api.ExecutionStrategy
isCloseOffloaded
-
Method Details
-
hasOffloads
default boolean hasOffloads()Returnstrue
if the instance has offloading for any operation.- Specified by:
hasOffloads
in interfaceExecutionStrategy
- Returns:
true
if the instance has offloading for any operation.
-
isConnectOffloaded
boolean isConnectOffloaded()Returns true if connection creation or accept requires offloading.- Returns:
- true if connection creation or accept requires offloading
-
merge
Combines this execution strategy with another execution strategy.- Specified by:
merge
in interfaceExecutionStrategy
- Parameters:
other
- The other execution strategy to combine. This is converted to aConnectExecutionStrategy
usingfrom(ExecutionStrategy)
.- Returns:
- The combined execution strategy.
-
offloadNone
Returns anConnectExecutionStrategy
that requires no offloading.- Returns:
- an
ConnectExecutionStrategy
that requires no offloading.
-
offloadAll
Returns anConnectExecutionStrategy
that requires offloading for all actions.- Returns:
- an
ConnectExecutionStrategy
that requires offloading.
-
from
Converts the provided execution strategy to aConnectExecutionStrategy
. If the provided strategy is alreadyConnectExecutionStrategy
it is returned unchanged. For other strategies, if the strategyExecutionStrategy.hasOffloads()
thenoffloadAll()
is returned otherwiseoffloadNone()
is returned.- Parameters:
executionStrategy
- TheExecutionStrategy
to convert- Returns:
- converted
ConnectExecutionStrategy
.
-