Reference

beanstalkc - A beanstalkd Client Library for Python

Core Classes

class beanstalkc.Connection(host='localhost', port=11300, parse_yaml=True, connect_timeout=None)[source]
bury(jid, priority=2147483648)[source]

Bury a job, by job id.

close()[source]

Close connection to server.

connect()[source]

Connect to beanstalkd server.

delete(jid)[source]

Delete a job, by job id.

ignore(name)[source]

Stop watching a given tube.

kick(bound=1)[source]

Kick at most bound jobs into the ready queue.

pause_tube(name, delay)[source]

Pause a tube for a given delay time, in seconds.

peek(jid)[source]

Peek at a job. Returns a Job, or None.

peek_buried()[source]

Peek at next buried job. Returns a Job, or None.

peek_delayed()[source]

Peek at next delayed job. Returns a Job, or None.

peek_ready()[source]

Peek at next ready job. Returns a Job, or None.

put(body, priority=2147483648, delay=0, ttr=120)[source]

Put a job into the current tube. Returns job id.

release(jid, priority=2147483648, delay=0)[source]

Release a reserved job back into the ready queue.

reserve(timeout=None)[source]

Reserve a job from one of the watched tubes, with optional timeout in seconds. Returns a Job object, or None if the request times out.

stats()[source]

Return a dict of beanstalkd statistics.

stats_job(jid)[source]

Return a dict of stats about a job, by job id.

stats_tube(name)[source]

Return a dict of stats about a given tube.

touch(jid)[source]

Touch a job, by job id, requesting more time to work on a reserved job before it expires.

tubes()[source]

Return a list of all existing tubes.

use(name)[source]

Use a given tube.

using()[source]

Return a list of all tubes currently being used.

watch(name)[source]

Watch a given tube.

watching()[source]

Return a list of all tubes being watched.

class beanstalkc.Job(conn, jid, body, reserved=True)[source]
bury(priority=None)[source]

Bury this job.

delete()[source]

Delete this job.

release(priority=None, delay=0)[source]

Release this job back into the ready queue.

stats()[source]

Return a dict of stats about this job.

touch()[source]

Touch this reserved job, requesting more time to work on it before it expires.

Exceptions

class beanstalkc.BeanstalkcException[source]
class beanstalkc.UnexpectedResponse[source]
class beanstalkc.CommandFailed[source]
class beanstalkc.DeadlineSoon[source]
class beanstalkc.SocketError[source]