Skip to main content

Pending events awaitable for asyncio

Instantiate a Pending awaitable, register events scheduled to be returned after a given number of seconds, and then await.

Once the first one (with smallest scheduling delay) is returned, re-await to get the next one, and so on. Optionally cancel or postpone (reschedule) scheduled events.

Example of use:

>>> import asyncio
>>> from pending import Pending
>>> events = Pending()
>>> events.schedule("second", 10)
>>> events.schedule("first", 9)
>>> async def main():
...    for i in len(events):
...       evt = await events
...       print(evt)
...
>>> asyncio.run(main())
first
second

Note: the registered "event" can be any hashable object.

Metadata

Release files for pending 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pending 1.3
File Size Uploaded
pending-1.3.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pending 1.3
File Interpreter ABI Platform
pending-1.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / pending-1.3.tar.gz

Download URL pending-1.3.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
824b74dde80606f993d2976b034e6ce6edaf3892e16f2e2b4a64cd8a29e59a34
BLAKE2b-256 checksum
How to use checksums
38d5420f1c40e868225f46a93fc71f2e477cefb6a9d7123dd41667f91f4b8976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release files / pending-1.3-py3-none-any.whl

Download URL pending-1.3-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a51fdc3fe5311c43dcd541049e76c666ba6c4938ff7515ae9ebb80f61f0ea77d
BLAKE2b-256 checksum
How to use checksums
9e5b0057f8aaa87f54171fae453d2fc92c89182e43f437adad70dc39d2e0c95f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release history Release notifications | RSS feed

This release

1.3 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page