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

Uploaded Python 3

File details

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

File metadata

  • Download URL: lemonrunner-0.3.6.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.6.tar.gz
Algorithm Hash digest
SHA256 c3b68bb0c8a5d1564021bff09dcc7bc63a3b848255c8588fa2db0ab083d550e3
MD5 05c293754ed25f40d31387980ac4c80f
BLAKE2b-256 5f66645a12c8ce8c00945194356548477fd56d750f0cf536b930f9121375f135

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lemonrunner-0.3.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7913cf6c5686edad3ee8a2933ae9d00e0a2dff165f657a47f03bacac1de32e13
MD5 e2a51d55ea1e84ed7a85779f4a52f2ce
BLAKE2b-256 840ab8e07c676c44257ee561aedf9cecf305ae900b6c6e7cc409e5cd1b1da89f

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