`asynkets` is a Python library which provides miscellaneous utilities that are useful when writing `asyncio` code.
Project description
asynkets
asynkets
is a Python library which provides miscellaneous utilities that are useful when writing asyncio
code.
Provided utilities include:
Switch
: A class that allows waiting for state changes of a switch that can be turned on or off. It provides async methods for waiting until it is in a specific state, and for waiting until it switches to a different state.EventfulCounter
: A counter that can be incremented or decremented and has optional minimum and maximum values. It also provides async methods for waiting until some threshold (either low or high) is reached, or until some threshold is reached or left, by leveraging Switches.Fuse
: Similar to asyncio's Event, but can only be set once.Pulse
: A pulse that can be triggered and waited for. It can also be given a function to call when it is triggered and can be used as an async iterator.PeriodicPulse
: A pulse that fires periodically at a specified interval and delay. It can be closed and used as an async iterator like the Pulse class.ensure_coroutine_function
andensure_async_iterator
: return guaranteed async versions of a sync or async function or iterable, respectively. If the function or iterable is synchronous, it will be wrapped to be async; if it is already async, it will be returned as-is.merge_async_iterables
: Merges multiple iterables or async iterables into one, yielding items as they are received.
Installation
asynkets
is available on PyPI and can be installed with pip
or your favorite package manager.
pip install asynkets
Usage
(todo)
License
The library is provided under the MIT license. See the LICENSE file for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asynkets-0.1.4.tar.gz
(12.9 kB
view details)
Built Distribution
asynkets-0.1.4-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file asynkets-0.1.4.tar.gz
.
File metadata
- Download URL: asynkets-0.1.4.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/6.1.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbe42f0bbf216c2ed61378ec8110e758c07a7ce76332e4b4e4fa8866879398fa |
|
MD5 | 60cfeba3b7f2e027b04f90d2980634ed |
|
BLAKE2b-256 | cefa250b7fedccacb34f0b9147b7bc96d6f5cabd8c7dd5df4b0c3c328a9be2a8 |
File details
Details for the file asynkets-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: asynkets-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/6.1.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 167d75f04454bcc5f312ec7d71f81f657091347910679694693b279777fe7dac |
|
MD5 | 07973dbc0e61fd96e5928cd2bbbe2690 |
|
BLAKE2b-256 | a72b4913296305e4d246fac32c4e2742e413a1da52d50eb72bc8c838deae2d07 |