Package io.servicetalk.http.api
Class HttpExecutionStrategies
java.lang.Object
io.servicetalk.http.api.HttpExecutionStrategies
A factory to create different
HttpExecutionStrategy.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionA Builder for creating customHttpExecutionStrategy.static HttpExecutionStrategyA special defaultHttpExecutionStrategythat provides safe default offloading of actions; the offloading used is unspecified and dependent upon the usage situation.static HttpExecutionStrategydifference(HttpExecutionStrategy left, HttpExecutionStrategy right) Find the difference between two strategies and provide a resulting strategy if there are differences in between the strategies.static HttpExecutionStrategyAnHttpExecutionStrategythat requires full offloading of the request-response path and transport events.static HttpExecutionStrategyDeprecated.static HttpExecutionStrategyAnHttpExecutionStrategythat requires no offloads on the request-response path or transport event path.
-
Method Details
-
defaultStrategy
A special defaultHttpExecutionStrategythat provides safe default offloading of actions; the offloading used is unspecified and dependent upon the usage situation. It may not be merged with other strategies because the resulting strategy would lose the defaulting behavior. As an additional safety measure all offload query methods will return true.- Returns:
- Default
HttpExecutionStrategy.
-
offloadNever
Deprecated.UseoffloadNone()instead.A specialHttpExecutionStrategythat disables all offloads on the request-response and transport event paths. This strategy is intended to be used only for client and server builders; it should not be returned byHttpExecutionStrategyInfluencer.requiredOffloads(), which should returnoffloadNone()instead. When merged with another execution strategy the result is always this strategy.- Returns:
HttpExecutionStrategythat disables all request-response path offloads.- See Also:
-
offloadNone
AnHttpExecutionStrategythat requires no offloads on the request-response path or transport event path. ForHttpExecutionStrategyInfluencers that do not block, theHttpExecutionStrategyInfluencer.requiredOffloads()method should return this value. UnlikeoffloadNever(), this strategy merges normally with other execution strategy instances.- Returns:
HttpExecutionStrategythat requires no request-response path offloads.- See Also:
-
offloadAll
AnHttpExecutionStrategythat requires full offloading of the request-response path and transport events. UnlikedefaultStrategy(), this strategy merges normally with other execution strategy instances.- Returns:
HttpExecutionStrategythat requires no request-response path offloads.- See Also:
-
customStrategyBuilder
A Builder for creating customHttpExecutionStrategy.- Returns:
- a builder for custom
HttpExecutionStrategy.
-
difference
@Nullable public static HttpExecutionStrategy difference(HttpExecutionStrategy left, HttpExecutionStrategy right) Find the difference between two strategies and provide a resulting strategy if there are differences in between the strategies. The resulting strategy can then be used to offload the difference between two strategies. This is typically used if there is a call hierarchy and each entity in the hierarchy defines its ownHttpExecutionStrategy. This method is useful to reduce duplicating work across these entities if the caller has already offloaded all the paths required to be offloaded by the callee.Entities: Entity 1 ⇒ Entity 2 ⇒ Entity 3 (calls) (calls) Strategies: No offloads Offload Send Offload Send + MetaIn the above call hierarchy, ifEntity 1uses this method to find theHttpExecutionStrategyto use for invokingEntity 2, the resultingHttpExecutionStrategywill only offload sending to the transport. However, ifEntity 2uses this method to find theHttpExecutionStrategyto use for invokingEntity 3, the resultingHttpExecutionStrategywill only offload receiving of metadata.Effectively, using this method will remove redundant offloading when more than one entity each provide their own
HttpExecutionStrategy.- Parameters:
left-HttpExecutionStrategywhich is already in effect.right-HttpExecutionStrategywhich is expected to be used.- Returns:
HttpExecutionStrategyif there are any differences between the two strategies.nullif the two strategies are the same.
-
offloadNone()instead.