模拟requests的timeout参数,使任意函数都拥有超时跳出的功能,防止访问超时阻塞影响代码的运行
Project description
安装
pip install with_timeout
使用示例
from with_timeout import with_timeout
@with_timeout(5)
def my_func():
pass
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
with_timeout-0.0.4.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for with_timeout-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b362ebb6826a5a4af99376acad7ff95dee8486d3d1a07f196c2aaf7e1f41a42f |
|
MD5 | e967a3507b4b6f7edb828decd4475688 |
|
BLAKE2b-256 | 8148f9dc4375e1af290792f9ea8f18e24ead472b40ed69a52b96ee2fc60f41ce |