Skip to main content

The missing call methods for python asyncio

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aiocall, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size aiocall-0.2.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page