Skip to main content

模拟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)

Uploaded Source

Built Distribution

with_timeout-0.0.3-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page