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.

Source Distribution

aiocall-0.2.tar.gz (2.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page