retry_later
@retry_later allows you to retry the execution of a function asynchronously in the background until it's done.
Why?
For example, you can retry sending an email until it's sent.
Installation
pip install retry-later
Usage
Simply add @retry_later() to your function. This also works with async functions.
Look inside the examples folder for more examples!
Here's a simple demonstration:
from my_very_python_real_email_client import send_mail_to_friend, send_text_to_friend
import asyncio
# Create new event loop
loop = asyncio.new_event_loop()
# Import the decorator
from retry_later import retry_later
@retry_later(retry_interval=10, max_retries=5, exception=ConnectionError)
def send_email():
send_mail_to_friend(email="veryrealperson@veryrealemail.haha", body="hi!")
@retry_later(retry_interval=10, max_retries=5, exception=ConnectionError)
async def send_a_text():
await send_text_to_friend(number="+123456789", body="hi! texting you")
send_email()
asyncio.run(send_a_text())
# Other stuff
print("Hi - I am here!! I complete before my_function!")
# event loop must be running for retry_later to work
loop.run_forever()
Metadata
Release files for retry-later 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 | Provenance | Actions |
|---|---|---|---|---|
| retry_later-0.0.5.tar.gz | 5.0 kB | Without provenance | Details for retry_later-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| retry_later-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for retry_later-0.0.5-py3-none-any.whl |
Total release size: 10.1 kB
Release files / retry_later-0.0.5.tar.gz
| Download URL | retry_later-0.0.5.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d8ec60122da4d8a651e4c8a3022cea04542b63ea80a33bf46f9de830fa2d258
|
|
BLAKE2b-256 checksum How to use checksums |
aebcd8b934d54008cbb748406ca07f4ddd522e683e2e896c760194290941a1b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / retry_later-0.0.5-py3-none-any.whl
| Download URL | retry_later-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
121a7ccb979c450f28cee0d4b2dd1792a2181d1eeb3936c36d64d6847899413f
|
|
BLAKE2b-256 checksum How to use checksums |
b930ba311d63618b462b64e6f3253ab974dbdd3f0cfbaed1a64af639dad03b36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Security for retry-later 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.