A waiting based utility with decorator and logger support
Project description
Introduction
Waits for a certain amount of time for an action to complete Designed to wait for a certain length of time, either linearly in 1 second steps, or exponentially, up to a maximum. Returns the output from the function once it completes successfully, along with the time taken to complete the command.
Usage
from wait_for import wait_for
class Incrementor():
value = 0
def i_sleep_a_lot(self):
time.sleep(.1)
self.value += 1
return self.value
incman = Incrementor()
ec, tc = wait_for(incman.i_sleep_a_lot,
fail_condition=0,
delay=.05)
print("Function output {} in time {} ".format(ec, tc))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wait_for-1.0.10.tar.gz
(9.9 kB
view hashes)
Built Distribution
Close
Hashes for wait_for-1.0.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d55e6bcdac4e11527abb3b39c884debed16ffd63d90d9bbe457ac8b75e147805 |
|
MD5 | 7edbfbcc6557579cacab039f36ca925a |
|
BLAKE2b-256 | 8d200686ff11ac51f2e5f2c49030f77ee090ad0be6c33fd672b1d26befa278a8 |