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 hashes)

Uploaded Python 2

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