Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

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

This version
History Node

0.2

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
aiocall-0.2.tar.gz (2.7 kB) Copy SHA256 hash SHA256 Source None Dec 29, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page