Beanstalk Client

Get Version


→ ‘beanstalk-client’


This is a Ruby client library for the Beanstalk protocol.

beanstalkd is a fast, distributed, in-memory work-queue service. Its interface is generic, but is intended for use in reducing the latency of page views in high-volume web applications by running most time-consuming tasks asynchronously.


First you must download and install the beanstalkd server.

Then just:

sudo gem install beanstalk-client

and you’re ready to go!

How to use it

Here’s an example of the low-level Ruby interface.

First, have one process put a job into the queue:

beanstalk =['localhost:11300'])

Then start another process to take jobs out of the queue and run them:

beanstalk =['localhost:11300'])
loop do
  job = beanstalk.reserve
  puts job.body # prints "hello"

Rails Integration

But you very likely want to use this in a Rails project. In that case, you should check out the Async Observer Rails plugin. It gives far more functionality and a super-easy-to-use interface.


There’s a google group called beanstalk-talk for all discussion regarding beanstalkd and the various client libraries.

How to submit patches

Read the 8 steps for fixing other people’s code and for section 8b: Submit patch to Google Groups, use the Google Group above.

The repository is for anonymous access.

You can browse the repo at


You can share this code under the terms of the GPL version 3.


Comments are welcome. Send any questions or comments to the beanstalk-talk google group.

Keith Rarick, 27th May 2008
Theme extended from Paul Battley