模拟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.3.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for with_timeout-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bfe479c42a85ae790f2dc39a2c1568962c02935bcaf5740dfa8f2b9b589dc8b |
|
MD5 | 3f2134124482f4b9b93593ce2dc21a59 |
|
BLAKE2b-256 | a6b13b7b60826bf158b9057f26bc7a7674c4c9b353f43acd64ea21d26a22a707 |