Pre-release
This release is a pre-release and may not be stable for production use.
Simple Resource Limite Decorators For Python Runtime
Decorators:
@set_runtime(seconds=0)
RuntimeError, max runtime of the function in decorators
@set_cpu_runtime(seconds=0)
RuntimeError, max soft cpu runtime of the function in decorators
@set_max_memory(size=0)
max memory of the function in decorators
@set_max_cpu(nproc=65535)
max memory of the function in decorators
set_max_cpu0(nproc=65535)
max ncpu of the function in main process, can not be used for decorators
Usage:
@set_runtime(seconds=5)
def test():
time.sleep(10)
test()
## RuntimeError
Install
pip install simpleresource
or:
pip install git+https://github.com/yodeng/simpleresource.git
Metadata
Release files for simpleresource 1.0.0b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simpleresource-1.0.0b0-py2-none-any.whl | Python 2 | none | any | Details |
Release files / simpleresource-1.0.0b0-py2-none-any.whl
| Download URL | simpleresource-1.0.0b0-py2-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
bea7abb99b326089b1eacd2c1c7cea429e024c3b545b41a07ef9feef37fa1e11
|
|
BLAKE2b-256 checksum How to use checksums |
6b4d70d32bac3d8147cc7643a6f882d0830c2fd2722b9e79763d52ddbe386ebc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.7.0 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16
|