模拟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.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for with_timeout-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89b0054a84a6fce639c4b98ba87aa110db55c0fd28466d9ef4eb6532a0268b32 |
|
MD5 | f91a64c3134cf2efde15af0e9707bd3f |
|
BLAKE2b-256 | f7dff9736ff6acce6d25e98eb25a2092d8a7269e0cbdcf05448c651bddd49ce4 |