In my last post I described how you make Drupal work with Gearman – a pretty good job server, which allows you to do things asynchronously, in the background. However cool Gearman is, there are a couple of downsides to the way it operates:
- Its queueing protocol is too simplistic. Once you claim an item from the queue, you cannot release it (unless you create a client in a worker and add the identical item), postpone (bury), etc. So if the worker dies, the item is lost.
- The Drupal integration module is sporadically maintained and still requires that you write quite a bit of code to get things working.
A great alternative is Beanstalkd. Written in C, it is super fast, and there is a PHP-written client – Pheanstalk – that provides for neat integration. Moreover, the Drupal module is actively maintained and has a full-fledged Drupal Queue backend class. Continue reading