AsyncBlink is a small extention to Blinker and enables you to use coroutines as receivers for your signals.
Install
Installation is simple, via pip:
$ pip install asyncblink
Usage
Usage is simple, too. Create a signal, connect some receivers to it
and then use the send() method to trigger all receivers
from asyncblink import signal
my_signal = signal('nice-signal')
async def coro_receiver(sender, **kwargs):
# an expensive io operation here
return 'done'
def receiver(sender):
return 'ok'
my_signal.connect(coro_receiver)
my_signal.connect(receiver)
my_signal.send('some-sender')
Other than that, AsyncBlink's usage is the same as Blinker, Take a look at the `Blinker documentation for further information.
Why this still exists?
Blinker now supports coroutines via signal.async_send, so why asyncblink
is still alive?
The blinker's implementation awaits for coroutines and it is not what I want so asyncblink schedules the coroutine and returns a task.
Source Code
Source code is hosted on github.
Metadata
Release files for asyncblink 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asyncblink-0.4.0.tar.gz | 2.5 kB | Details |
Release files / asyncblink-0.4.0.tar.gz
| Download URL | asyncblink-0.4.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a4d3a77c4692aeafc6c0a76204f09ba2f2006af7964ec8bc26b58208d5ec807
|
|
BLAKE2b-256 checksum How to use checksums |
b4cc23b86504b2c32757d1dd3ccc351eb9d7527bedcde21f8ae5872f0fae5e82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|