Skip to main content

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


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

simpleresource-1.0.0b0-py2-none-any.whl (2.6 kB view details)

Uploaded Python 2

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

Hashes for simpleresource-1.0.0b0-py2-none-any.whl
Algorithm Hash digest
SHA256 bea7abb99b326089b1eacd2c1c7cea429e024c3b545b41a07ef9feef37fa1e11
MD5 91852fc0fce61a299e894a98e3eaf3af
BLAKE2b-256 6b4d70d32bac3d8147cc7643a6f882d0830c2fd2722b9e79763d52ddbe386ebc

See more details on using hashes here.

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