Polling2: Never write another polling function

Release v0.5.0.

https://travis-ci.com/ddmee/polling2.svg?branch=master https://img.shields.io/pypi/dm/polling2.svg https://img.shields.io/pypi/pyversions/polling2.svg Documentation Status Quality Gate Status Bugs Vulnerabilities Security Rating Code Smells

Polling2 is a powerful python utility used to wait for a function to return when the specified condition is met.


polling2 is available from Pypi.:

python -m pip install polling2


Watch polling do some arbitrary dances:

>> import polling2, time
>> # Wait until the number of seconds (ignoring milliseconds) is divisible by 5.
>>  polling2.poll(target=time.time, check_success=lambda x: int(x) % 5 == 0, step=0.5, timeout=6)
>> # Lets use the decorator version to create a function that waits until the next even second.
>> @polling2.poll_decorator(check_success=lambda x: int(x) % 2 == 0, step=0.5, timeout=6)
... def even_time():
...     return time.time()
>> even_time()
>> even_time()

View all the examples:


Contributor Guide

If you want to contribute to the project…

Release notes

The change log for each released version.

Indices and tables