RetryAfterExtension

com.github.cloudfiles.core.http.RetryAfterExtension

An extension actor that intercepts requests, which failed with a 429 - TOO MANY REQUESTS status code and retries them after a delay.

When interacting with public servers and downloading or uploading many small files, the server can reject requests with the failure status 429. In this case, the response should typically contain a ''Retry-After'' header that determines when further requests are accepted again. The actor evaluates this header and re-schedules the execution of the request when this point of time is reached.

The actor can be configured with a minimum delay, which is also used if a response does not contain a ''Retry-After'' header.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class RetryAfterConfig(minimumDelay: FiniteDuration)

A configuration class defining all the options supported by a RetryAfterExtension actor.

A configuration class defining all the options supported by a RetryAfterExtension actor.

Value parameters

minimumDelay

the minimum delay when retrying a request

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def apply(requestSender: ActorRef[HttpCommand], config: RetryAfterConfig): Behavior[HttpCommand]

Returns the behavior of a new actor instance. Requests are forwarded to the given request actor. The minimum delay contained in the configuration provided is a lower bound for the delays used by this actor; it is also applied if no ''Retry-After'' header is found in the response.

Returns the behavior of a new actor instance. Requests are forwarded to the given request actor. The minimum delay contained in the configuration provided is a lower bound for the delays used by this actor; it is also applied if no ''Retry-After'' header is found in the response.

Value parameters

config

the configuration for this actor

requestSender

the request sender to decorate

Attributes

Returns

the behavior of the new actor

Concrete fields

final val DefaultMinimumDelay: FiniteDuration

The default minimum delay when handling 429 responses.

The default minimum delay when handling 429 responses.

Attributes