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.4.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.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lemonrunner-0.3.4.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.4.tar.gz
Algorithm Hash digest
SHA256 1d35075cb6e5d3fff2da4d87cebe2bd1abdede03f2be38a7867b87afeb0dce0a
MD5 a941798f4de5a9602e7a8f4d1da84a7b
BLAKE2b-256 ef54adc4930002015cde41b9430dc521ef303e0afa0bfb3af0e4639263162423

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lemonrunner-0.3.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c5fa94f8f0bcabb7092eff3e4fbec6c0a213fd5eb0ba846c64e08bb118886626
MD5 192ccc4e6e01ba67063e80a12627226c
BLAKE2b-256 7d0203c92d719701de009e9928768afdb1fe8847caaf7ada51a9b46ee27683d5

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