Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lowhaio-retry

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lowhaio-retry

Wrapper that retries failed lowhaio HTTP requests

  • 0.0.5
  • PyPI
  • Socket score

Maintainers
1

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'),),
)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc