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
is_done, is_timeout, erro_message, results = func_with_timeout(a=12, b=8)
You will find that after the method is called to the time you specified, it will return and kill the currently executing thread.
You can also use it as a decorator
import time
from call_function_with_timeout import SetTimeoutDecorator
# make your function with timeout
@SetTimeoutDecorator(timeout=5)
def do_something(a=0, b=0):
time.sleep(10)
print(a + b)
# call the function
is_done, is_timeout, erro_message, results = do_something(a=12, b=8)
Metadata
Release files for call-function-with-timeout 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| call_function_with_timeout-1.1.1.tar.gz | 3.5 kB | Without provenance | Details for call_function_with_timeout-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| call_function_with_timeout-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for call_function_with_timeout-1.1.1-py3-none-any.whl |
Total release size: 7.9 kB
Release files / call_function_with_timeout-1.1.1.tar.gz
| Download URL | call_function_with_timeout-1.1.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4ebd4c67d72d53772ce039540fbfeffc9dfadd31574aec171b830925706cdd6
|
|
BLAKE2b-256 checksum How to use checksums |
cba224526b29a9ff80a5388504b13f04413d5a13e703be43a64cc61a99785ee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / call_function_with_timeout-1.1.1-py3-none-any.whl
| Download URL | call_function_with_timeout-1.1.1-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2af11d65db1c733a30b15445f492fd5c98432154afba2455bf89c6f9e7ef0a30
|
|
BLAKE2b-256 checksum How to use checksums |
e55e1ccbaf71a609d62548f08a050dbfc47ca066ce39df5f53a1a875795f2bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for call-function-with-timeout 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.