ruote-beanstalk Rubygems

beanstalk extensions for ruote (a ruby workflow engine)


Beanstalk extensions for ruote (a Ruby workflow engine).

Beanstalk is a simple, fast, workqueue service.

ruote-beanstalk provides two things, first a ParticipantProxy / Receiver pair, second a ruote storage implementation.

The ParticipantProxy / Receiver pair is about emitting workitems to a Beanstalk queue/tube and listening/receiving them back. Workers can connect to the Beanstalk queue, receive workitems, do some work and then (optionally) send the updated workitem back to the ruote system.

Ruote::Beanstalk::Storage is a storage implementation for ruote. Workers and engines can connect over Beanstalk to a shared storage.

The storage listens to a Beanstalk queue where it receives storage orders that it conveys to a FsStorage instance.

(Initially I tried to use Beanstalk for msgs and schedules as well, but since you can’t delete a delayed message in Beanstalk (as of now), I fell back to using Beanstalk as middleware, it’s slightly slower, but much simpler and robust).

rdoc :


Ruote::Beanstalk::ParticipantProxy and Receiver

Registering a Beanstalk participant :

    'beanstalk' => '',
    'tube' => 'ruote-workitems')

Binding a listener to a storage or an engine :
    engine, '', 'tube' => 'ruote-incoming')

      # or
    storage, '', 'tube' => 'ruote-incoming')

The receiver manages a thread that listens to incoming messages and feeds them to ruote via the engine or directly via a storage.


There are two modes in which Storage can be used :

  • bound to a remote storage (client)
  • bound to the physical storage (server)

There should always be at least 1 server and 1 client.

Beanstalk is the intermediary.


Pass a string of the form host:port and a hash of options :'', opts)

Wrapped in an engine + worker :

  engine ='', opts)))


This piece of ruby starts a Beanstalk instance (:fork => true) and starts a BsStorage ‘server’ coupled to an embedded FsStorage :

  require 'ruote/beanstalk'':11300', 'ruote_work', :fork => true)

running tests

Ruote::Beanstalk::ParticipantProxy and Receiver

Simply do

  ruby test/test.rb

in your ruote-beanstalk/ directory.


assuming you have


In a separate terminal, go to ruote-beanstalk/ and launch

  ruby serve.rb

To launch a beanstalkd + fs storage couple, then run unit or functional tests

  • unit tests :

get into ruote/ and do

  ruby test/unit/storage.rb -- --beanstalk
  • functional tests :

get into ruote/ and do

  ruby test/functional/test.rb -- --beanstalk





many thanks to

  • the beanstalk authors and contributors

Related Repositories



beanstalk extensions for ruote (a ruby workflow engine) ...

Top Contributors



-   v2.2.0 zip tar
-   v2.1.11 zip tar
-   v2.1.10 zip tar