Classifiers¶
Retries are only safe when they respect protocol/domain semantics.
Classifiers implement:
The executor records Outcome on every attempt, and uses it to decide whether to retry, stop, or abort immediately.
Built-ins¶
Core built-ins include:
classify.AutoClassifier(default): Intelligently dispatches toHTTPClassifierorAlwaysRetryOnErrorbased on error type. This works automatically withrecourse/integrations/http, which returns errors implementing theHTTPErrorinterface.classify.ClassifierHTTP("http"): HTTP-aware decisions (e.g., 5xx retryable, 404 non-retryable, 429 may respectRetry-After).integrations/grpc.Classifier: gRPC status-code aware decisions (available viaintegrations/grpcmodule).
Select a classifier by name via policy.RetryPolicy.ClassifierName.
Safety: type mismatches¶
If a classifier expects a specific value/error shape and receives something else, it should fail loudly and safely (e.g., non-retryable with a clear reason), not “retry blindly”.