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 Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page