Skip to main content

A reusable async retry handler with exponential backoff and structured logging.

Project description

retry-function-plugin

A reusable async retry handler with exponential backoff and structured logging.

🚀 Features

  • Handles retries automatically with exponential backoff and jitter.
  • Logs all attempts with correlation IDs for traceability.
  • Supports timeout and async/await-based retry patterns.

🧩 Example Usage

import asyncio
from retry_function_plugin import execute_with_retry

async def unstable_task():
    import random
    if random.random() < 0.7:
        raise Exception("Random failure!")
    return "Success!"

async def main():
    result, error = await execute_with_retry(unstable_task, max_retries=3, base_delay=1)
    if error:
        print(f"Task failed: {error}")
    else:
        print(f"Task succeeded: {result}")

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retry_function_plugin-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

retry_function_plugin-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file retry_function_plugin-0.1.0.tar.gz.

File metadata

  • Download URL: retry_function_plugin-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for retry_function_plugin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07498acb5611d8050b5021e9a26b2a8e74547362df220eb403a2a18a64f8439a
MD5 ebfdd56cc197c69e4a08571ea054fa4a
BLAKE2b-256 4b57c13fce71225f302543197f9becc5c74c98f2a3ab54f415de4c2b29517dd4

See more details on using hashes here.

File details

Details for the file retry_function_plugin-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for retry_function_plugin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bed0b1706a7e3280c3ec84431d3c1eef0acd1b060e5d6619525f7ff9906882a
MD5 be8acb5034b39a022eb755d80511c542
BLAKE2b-256 ed6ae7ed8973e7c6b053112e46599262220972b4da9c4012e74823c2eba6b740

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page