Python Call function with timeouts
Project description
call_function_with_timeout
A library to make your funtions support timeouts
Example
import time
from call_function_with_timeout import SetTimeout
# make your function
def do_something(a=0, b=0):
time.sleep(10)
print(a + b)
# define function with timeout
func_with_timeout = SetTimeout(do_something, timeout=5)
# call the function
res = func_with_timeout(a=12, b=8)
print(res)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for call_function_with_timeout-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a6a98b341fe52535f22841f6d8e9d4e33d8954cff8c824e73f40cd4c76afc88 |
|
MD5 | e54514acc8ca9b7b309699c36971def7 |
|
BLAKE2b-256 | 0549a38609b1a455f9aa317f0f68efe45b77ffdcbeb5b999d15fc34c198cda21 |
Close
Hashes for call_function_with_timeout-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea0822690e6dd24fbc8efdacd6f8281970fcb849104b35f15ae6445043b0578c |
|
MD5 | 65535ff157be7ae2c2b0fc21d12ae1ba |
|
BLAKE2b-256 | e58b03fdfe150134cde9c875a69b3a33eadfa4d57b172581db6871f7bae4c679 |