No project description provided
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file simpleresource-1.0.0b0-py2-none-any.whl
.
File metadata
- Download URL: simpleresource-1.0.0b0-py2-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 2
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea7abb99b326089b1eacd2c1c7cea429e024c3b545b41a07ef9feef37fa1e11 |
|
MD5 | 91852fc0fce61a299e894a98e3eaf3af |
|
BLAKE2b-256 | 6b4d70d32bac3d8147cc7643a6f882d0830c2fd2722b9e79763d52ddbe386ebc |