bypassLimitResolverInternal
protected final BuilderT bypassLimitResolverInternal(java.util.function.Predicate<?> shouldBypass)
Add a chainable bypass resolver predicate from context. Multiple resolvers may be added and if any of the
predicate condition returns true the call is bypassed without increasing the limiter inflight count and
affecting the algorithm. Will not bypass any calls by default if no resolvers are added.
Due to the builders not having access to the ContextT, it is the duty of subclasses to ensure that
implementations are type safe.
Predicates should not rely strictly on state of the Limiter (such as inflight count) when evaluating
whether to bypass. There is no guarantee that the state will be synchronized or consistent with respect to
the bypass predicate, and the bypass predicate may be called by multiple threads concurrently.
- Parameters:
shouldBypass
- Predicate condition to bypass limit
- Returns:
- Chainable builder