Skip to main content

No project description provided

Project description

Lemonrunner

Run this forever and stream the results.

The entry point is the Lemonrunner-class, which exposes the run-method. Run takes an id, a function, and optional key-word arguments for args, kwargs, timeout, times and interval.

Any function passed to run will be run either forever, or N times, if the times arument is given. Returns, yielded values or exceptions are all retrieved from the monitor-method.

The monitor function of the Lemonrunner-class is a generator which yields each message from each function as they come in.

Example

from time import sleep

from lemonrunner import Lemonrunner

def foo():
	raise ValueError

def bar():
	sleep(3)
	return 5

def baaz():
	yield 'abc'

runner = Lemonrunner()

runner.run('foo', foo, interval=1)
runner.run('bar', bar, interval=1, timeout=2)
runner.run('baaz', baaz, times=2)

for id, message_type, timestamp, return_value in runner.monitor():
	print(id, message_type, timestamp, return_value)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lemonrunner-0.3.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lemonrunner-0.3.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file lemonrunner-0.3.3.tar.gz.

File metadata

  • Download URL: lemonrunner-0.3.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for lemonrunner-0.3.3.tar.gz
Algorithm Hash digest
SHA256 5c774dc32541a37b2d7d130846ea08b1a76340dc285be114aa98ca5e63cead4f
MD5 f313e0dc2539e801a8325a854a38b1cc
BLAKE2b-256 064dee3acb3fef8c065854caa3cd230b0a891bbd7a06e2f6c194c3ec7756967d

See more details on using hashes here.

File details

Details for the file lemonrunner-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: lemonrunner-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for lemonrunner-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d30500af889f85ca39d70b6b2dc0b6d394d369614ece9c21d6c8eb4024e3efec
MD5 13666075b406acf7c8f1068656d2cdab
BLAKE2b-256 81fb5be7f130c959cd2a815275bf5e12c5108a428f1558bb6803e44260305685

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page