Request for comment (RFC) for potential feature:
To allow a user to define more complex retries not available through constructor options we could provide a retry base class that has abstract methods that the user can inherit from and design.
For example, if I want infinite retries on 1XX status codes with not backoff or jitter but provide an allowance for 4XX and 5XX status codes with backoff or jitter I don't see a way to do that today.
Example:
from httpx_retries import BaseRetry, RetryTransport
class MySuperComplexRetry(BaseRetry):
# need to clarify which abstract methods need to be defined
...
transport = RetryTransport(retry=MySuperComplexRetry())
An alternative already exists for this today since the user can technically just subclass Retry and override methods but this may present a cleaner option so that we could define the exact methods that an BaseRetry child class must define.
Request for comment (RFC) for potential feature:
To allow a user to define more complex retries not available through constructor options we could provide a retry base class that has abstract methods that the user can inherit from and design.
For example, if I want infinite retries on
1XXstatus codes with not backoff or jitter but provide an allowance for4XXand5XXstatus codes with backoff or jitter I don't see a way to do that today.Example:
An alternative already exists for this today since the user can technically just subclass
Retryand override methods but this may present a cleaner option so that we could define the exact methods that anBaseRetrychild class must define.