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.1.3.tar.gz
(12.6 kB
view hashes)
Built Distribution
Close
Hashes for wait_for-1.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 037c29ce2639b385790fce0fa383691e4b7b2e523e91916ecdb87d5fdefd7697 |
|
MD5 | 3dbe6fc8853766e3cf326acfd93e0c2b |
|
BLAKE2b-256 | d98a7a38c7149d0a4a0f7c2582bc167859e953a7da0015098c7a383513534058 |