The missing call methods for python asyncio.
I found that python asyncio is lacking some basic methods to invoke calls:
call_soon_periodic(interval, callback, *args)
call_later_periodic(delay, interval, callback, *args)
This module provides these methods.
Example:
import asyncio
import aiocall
def do_something(what):
print('doing', what)
timer = aiocall.call_later_periodic(0.5, 1.0, do_something, 'stuff')
loop = asyncio.get_event_loop()
loop.call_later(4.0, timer.cancel)
loop.call_later(5.0, loop.stop)
loop.run_forever()
loop.close()
Output:
doing stuff doing stuff doing stuff doing stuff
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiocall-0.2.tar.gz
(2.7 kB
view details)
File details
Details for the file aiocall-0.2.tar.gz.
File metadata
- Download URL: aiocall-0.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98ee66d13bbe584a7dd99880c618b8bfbd410df5083a66eca62282b541746f3e
|
|
| MD5 |
5aaa2558f39503b8b6ae68f70d3337ce
|
|
| BLAKE2b-256 |
44bff0a112c7a82c6c7382f9f8e7f0a891ac377a475ff1a86c6a6cad2e40f8e8
|