Welcome to Greenstalk

Greenstalk is a Python client library for communicating with the beanstalkd work queue. It makes it easy to write:

  • Producers, processes that insert jobs into a queue:

import greenstalk

with greenstalk.Client(host='127.0.0.1', port=11300) as queue:
    queue.put('hello')
  • Consumers, processes that take jobs from a queue and execute some work:

import greenstalk

with greenstalk.Client(host='127.0.0.1', port=11300) as queue:
    while True:
        job = queue.reserve()
        print(job.body)
        queue.delete(job)

Contents

Inspiration

Greenstalk is heavily inspired by the following libraries: