lowhaio-retry
Wrapper that retries failed lowhaio HTTP requests. Allows retries of exceptions from failed HTTP requests.
Installation
pip install lowhaio_retry
Usage
The request function returned from lowhaio.Pool must be wrapped with lowhaio_retry.retry, as in the below example. This will retry the request, waiting the specified interval between retries. If the request still fails, the final exception will be bubbled up to client code.
So instead of a request like
from lowhaio import Pool
request, _ = Pool()
body = ...
code, headers, body = await request(
b'PUT', 'https://example.com/path', body=body,
headers=((b'content-length', b'1234'),),
)
you can write
from lowhaio import Pool, HttpConnectionError, HttpDataError
from lowhaio_retry import retry
request, _ = Pool()
retriable_request = retry(request,
exception_intervals=(
# Seconds to wait after each exception
(HttpConnectionError, (0, 0, 0)),
(HttpDataError, (0, 1, 2, 4)),
),
)
body = ...
code, headers, body = await retriable_request(
b'PUT', 'https://example.com/path', body=body,
headers=((b'content-length', b'1234'),),
)
Metadata
Release files for lowhaio-retry 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lowhaio_retry-0.0.5.tar.gz | 2.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lowhaio_retry-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.0 kB
Release files / lowhaio_retry-0.0.5.tar.gz
| Download URL | lowhaio_retry-0.0.5.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ec4a70777307a828ce103af07c578eedf8f0d3d39644111a723a5edda4f994d
|
|
BLAKE2b-256 checksum How to use checksums |
0b5709b998a03b60d5fa564adc32fd513eb479100f157c2b05202288b8770e5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Release files / lowhaio_retry-0.0.5-py3-none-any.whl
| Download URL | lowhaio_retry-0.0.5-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
587a71f85db754d53d72d13239bacbf3c30cb372e682cafe8088a82f297eb5c4
|
|
BLAKE2b-256 checksum How to use checksums |
b6da9da9c328cac8259c89651b59aae146a8580f3886bf2cabf086fadf0a4ba0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|