http_retry_request_with_sleep_middleware

Documentation for eth_defi.middleware.http_retry_request_with_sleep_middleware function.

http_retry_request_with_sleep_middleware(make_request, web3)[source]

A HTTP retry middleware with sleep and backoff.

TODO: Convert this to class so that we can customise arguments

Usage:

web3.middleware_onion.clear()
web3.middleware_onion.inject(http_retry_request_with_sleep_middleware, layer=0)
Parameters
  • make_request (Callable[[RPCEndpoint, Any], Any]) – Part of middleware call signature

  • web3 (web3.main.Web3) – Part of middleware call signature

Return type

Callable[[RPCEndpoint, Any], Any]