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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b091c324d32e1420d967f7de2d85beb3bf90c5ec6e946b955eecb278adf757d |
|
MD5 | 56ac9a4a6fdf9b138dd7d2f6f8183af8 |
|
BLAKE2b-256 | 2c7e57a65881ebfd15a86678f1ad78d19c06652a732d355331aac8198f73f7d9 |
Close
Hashes for call_function_with_timeout-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f0f03ff4a5fa07f86a168f7868f016182f690046794aef2696ce6437fc29e71 |
|
MD5 | ee133c52feaec4df9d7e649c9e6091b9 |
|
BLAKE2b-256 | 453aaad89c06f9fa87c29e482bdcdc28590a9bfe43c1e094935870d2aeabe15a |