module

CRE::Http::Retry

Retry wraps a Proc with bounded retry-with-jitter. Default policy: 3 attempts (initial + 2 retries), 200ms..2s exponential backoff with full jitter, retries network errors and the canonical transient statuses listed above.

Constants

Log = ::Log.for("cre.http.retry")

Class methods

with(*, attempts : Int32 = 3, base_delay : Time::Span = 200.milliseconds, max_delay : Time::Span = 2.seconds, retry_statuses : Set(Int32) = RETRY_STATUSES, label : String = "http", &block : -> HTTP::Client::Response) : HTTP::Client::Response
Source