Package io.quarkus.load.shedding
Interface RequestClassifier<R>
- Type Parameters:
R- type of the request
- All Known Implementing Classes:
HttpRequestClassifier
public interface RequestClassifier<R>
Assigns a cohort number to a request. There is 128 statically defined cohorts,
where the minimum cohort number is 1 and maximum is 128, inclusive. All classifiers
are inspected and the first one that returns
true for appliesTo(Object)
is taken.
An implementation must be a CDI bean, otherwise it is ignored. CDI typesafe resolution
rules must be followed. That is, if multiple implementations are provided with different
Priority values, only the implementations with the highest
priority are retained.
-
Field Summary
Fields -
Method Summary
-
Field Details
-
MIN_COHORT
static final int MIN_COHORT- See Also:
-
MAX_COHORT
static final int MAX_COHORT- See Also:
-
-
Method Details
-
appliesTo
Returns whether this request classifier applies to givenrequest.- Parameters:
request- the request, nevernull- Returns:
- whether this request classifier applies to given
request
-
cohort
Returns the cohort to which the givenrequestbelongs.- Parameters:
request- the request, nevernull- Returns:
- the cohort to which the given
requestbelongs
-