Skip to main content

RunnerBean ========== A simple tool for creating long-running Python workers listening for Beanstalk jobs. Jobs should be posted as a JSON object, with each key mapping to a callable's keyword arguments. Usage:: import logging from RunnerBean import Runner def print_message(recipient, message): """accepts a job with the following structure: { 'recipient': 'joe bloggs', 'message': 'Hello world!', } """ print recipient, message return True # this deletes the job from the tube if __name__ == '__main__': runner = Runner(print_message, tubes="messages", # string or list of tubes to listen on host='0.0.0.0', # beanstalkd host port=11300, # beanstalkd port loglevel=logging.DEBUG, # set log level, default: ERROR logfile='runnerbean.log' # set the logfile ) runner.run()

Project description

A simple tool for creating long-running Python workers listening for Beanstalk jobs.

Jobs should be posted as a JSON object, with each key mapping to a callable’s keyword arguments.

Usage:

import logging
from RunnerBean import Runner

def print_message(recipient, message):
    """accepts a job with the following structure:
    {
        'recipient': 'joe bloggs',
        'message': 'Hello world!',
    }
    """
    print recipient, message

    return True # this deletes the job from the tube

if __name__ == '__main__':
    runner = Runner(print_message,
                    tubes="messages", # string or list of tubes to listen on
                    host='0.0.0.0', # beanstalkd host
                    port=11300, # beanstalkd port
                    loglevel=logging.DEBUG, # set log level, default: ERROR
                    logfile='runnerbean.log' # set the logfile
                    )
    runner.run()

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

RunnerBean-0.3.3-dev.tar.gz (3.1 kB view hashes)

Uploaded Source

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