Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A python library for the kestrel queue system
branch: master
Failed to load latest commit information.
kestrel A little code cleanup
.gitignore Import
README.mkd updated readme prep 0.5.1 go back to allowing multiple servers


A Python Kestrel library

This is a simple client library for the kestrel queue system. It supports the entire documented protocol.

This library extends the Client class in the python-memcached library to add support for the non-memcache calls that kestrel supports like: config, reload, and shutdown.


You should only send strings through to the queue, if not the python-memcached library will serialize these objects and since kestrel ignores the flags supplied during a set operation, when the object is retrieved from the queue it will not be unserialized.


Adding an job to the queue:

import kestrel

q = kestrel.Client(servers=['']) q.add('test_queue', 'some test job') q.close() # disconnect the client

Read a job from the queue:

job = q.get('test_queue')

Peek at the next job in line:

job = q.peek('test_queue')

Reliably read a set of jobs from the queue:

while True:
    job ='test_queue', timeout=10) # marks the last job as complete and gets a new one, also waits 10 seconds if no jobs are currently in the queue
    if job is not None:
            #process job
            q.abort('test_queue') # mark the job as failed.

q.finish('test_queue') # mark the last job a complete

Something went wrong with that request. Please try again.