httpx/sig/plugins/retries.rbs
2021-09-20 12:37:48 +01:00

44 lines
1012 B
Plaintext

module HTTPX
module Plugins
module Retries
MAX_RETRIES: Integer
IDEMPOTENT_METHODS: Array[verb]
RETRYABLE_ERRORS: Array[singleton(StandardError)]
DEFAULT_JITTER: ^(Numeric) -> Numeric
interface _RetryCallback
def call: (response) -> bool?
end
interface _RetriesOptions
def retry_after: () -> Numeric?
def retry_jitter: () -> ^(Numeric) -> Numeric
def max_retries: () -> Integer?
def retry_change_requests: () -> boolish
def retry_on: () -> _RetryCallback?
end
def self.extra_options: (Options) -> (Options & _RetriesOptions)
module InstanceMethods
def max_retries: (int) -> instance
private
def __repeatable_request?: (Request, Options) -> boolish
def __retryable_error?: (_Exception) -> bool
end
module RequestMethods
def retries: () -> Integer
end
end
type sessionRetries = Session & Retries::InstanceMethods
end
end