PHPackages                             slm/queue-beanstalkd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. slm/queue-beanstalkd

AbandonedArchivedLibrary[Queues &amp; Workers](/categories/queues)

slm/queue-beanstalkd
====================

Zend Framework 2 module that integrates with Beanstalkd queuing system

v0.4.2(10y ago)1077.5k↓43.3%27[2 issues](https://github.com/Webador/SlmQueueBeanstalkd/issues)[1 PRs](https://github.com/Webador/SlmQueueBeanstalkd/pulls)1BSD-3-ClausePHPPHP &gt;=5.3.3

Since Feb 9Pushed 4y ago4 watchersCompare

[ Source](https://github.com/Webador/SlmQueueBeanstalkd)[ Packagist](https://packagist.org/packages/slm/queue-beanstalkd)[ Docs](https://github.com/juriansluiman/SlmQueueBeanstalkd)[ RSS](/packages/slm-queue-beanstalkd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (12)Used By (1)

SlmQueueBeanstalkd
==================

[](#slmqueuebeanstalkd)

[![Build Status](https://camo.githubusercontent.com/694d9ba8b5ceeeed88649631dfee09c923492baa8f932112e51359e694354033/68747470733a2f2f7472617669732d63692e6f72672f6a757269616e736c75696d616e2f536c6d51756575654265616e7374616c6b642e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/juriansluiman/SlmQueueBeanstalkd)[![Latest Stable Version](https://camo.githubusercontent.com/2f044593d129df985be60f38408d5278abf4bf5abc36ed3b51f83d239facc851/68747470733a2f2f706f7365722e707567782e6f72672f736c6d2f71756575652d6265616e7374616c6b642f762f737461626c652e706e67)](https://packagist.org/packages/slm/queue-beanstalkd)[![Latest Unstable Version](https://camo.githubusercontent.com/977af941e01ef094ad6f1fb42e4d6f6baa1dacbf5b2c6b9312ac109745576580/68747470733a2f2f706f7365722e707567782e6f72672f736c6d2f71756575652d6265616e7374616c6b642f762f756e737461626c652e706e67)](https://packagist.org/packages/slm/queue-beanstalkd)

Created by Jurian Sluiman and Michaël Gallego

Requirements
------------

[](#requirements)

- [Zend Framework 2](https://github.com/zendframework/zf2)
- [SlmQueue](https://github.com/juriansluiman/SlmQueue)
- [Pda Pheanstalk](https://github.com/pda/pheanstalk)

Installation
------------

[](#installation)

First, install SlmQueue ([instructions here](https://github.com/juriansluiman/SlmQueue/blob/master/README.md)). Then, add the following line into your `composer.json` file:

```
"require": {
	"slm/queue-beanstalkd": "0.4.*"
}
```

Then, enable the module by adding `SlmQueueBeanstalkd` in your application.config.php file. You may also want to configure the module: just copy the `slm_queue_beanstalkd.local.php.dist` (you can find this file in the config folder of SlmQueueBeanstalkd) into your config/autoload folder, and override what you want.

Documentation
-------------

[](#documentation)

Before reading SlmQueueBeanstalkd documentation, please read [SlmQueue documentation](https://github.com/juriansluiman/SlmQueue).

(Don't forget to first install Beanstalkd, and to run the daemon program on the server)

### Setting the connection parameters

[](#setting-the-connection-parameters)

Copy the `slm_queue_beanstalkd.local.php.dist` file to your `config/autoload` folder, and follow the instructions.

### Adding queues

[](#adding-queues)

SlmQueueBeanstalkd provides an interface for a queue that implements `SlmQueue\Queue\QueueInterface` and provides in addition the following methods:

- release(JobInterface $job, array $options = array()): when a job fails, you can add the job again to the queue by releasing it, so that it can have another chance to be executed.
- bury(JobInterface $job, array $options = array()): when a job fails and that it has not been manually released, it is automatically buried.
- kick($max): when this method is called, it will move a maximum of $max buried jobs back to the queue.

A concrete class that implements this interface is included: `SlmQueueBeanstalkd\Queue\BeanstalkdQueue` and a factory is available to create the queue. Therefore, if you want to have a queue called "email", just add the following line in your `module.config.php` file:

```
return array(
    'slm_queue' => array(
        'queue_manager' => array(
            'factories' => array(
                'email' => 'SlmQueueBeanstalkd\Factory\BeanstalkdQueueFactory'
            )
        )
    )
);
```

This queue can therefore be pulled from the QueuePluginManager class.

### Operations on queues

[](#operations-on-queues)

#### push

[](#push)

Valid options are:

- priority: the lower the priority is, the sooner the job get popped from the queue (default to 1024)
- delay: the delay in seconds before a job become available to be popped (default to 0 - no delay -)
- ttr: in seconds, how much time a job can be reserved for (default to 60)

Example:

```
$queue->push($job, array(
    'priority' => 20,
    'delay'    => 23,
    'ttr'      => 50
));
```

#### pop

[](#pop)

Valid option is:

- timeout: by default, when we ask for a job, it will block until a job is found (possibly forever if new jobs never come). If you set a timeout (in seconds), it will return after the timeout is expired, even if no jobs were found

#### release

[](#release)

Valid options are:

- priority: the lower the priority is, the sooner the job get popped from the queue (default to 1024)
- delay: the delay in seconds before a job become available to be popped (default to 0 - no delay -)

#### bury

[](#bury)

Valid option is:

- priority: the lower the priority is, the sooner the job get kicked

### How to bury/release a job

[](#how-to-buryrelease-a-job)

Beanstalkd offers a nice bury/kick/release mechanism, so that jobs that fail can have a second chance to be executed. SlmQueueBeanstalkd provides a nice way to easily bury/release a job. In fact, you just need to throw either the `SlmQueueBeanstalkd\Job\Exception\BuryableException` or `SlmQueueBeanstalkd\Job\Exception\ReleasableException` in the `execute` method of your job:

```
use SlmQueue\Job\AbstractJob;
use SlmQueueBeanstalkd\Job\Exception;

class SimpleJob extends AbstractJob
{
    public function execute()
    {
        // Bury the job, with a priority of 10
        throw new Exception\BuryableException(array('priority' => 10));

        // Release the job, with a priority of 10 and delay of 5 seconds
        throw new Exception\ReleasableException(array('priority' => 10, 'delay' => 5));
    }
}
```

### Executing jobs

[](#executing-jobs)

SlmQueueBeanstalkd provides a command-line tool that can be used to pop and execute jobs. You can type the following command within the public folder of your Zend Framework 2 application:

`php index.php queue beanstalkd  [--timeout=]`

The queue is a mandatory parameter, while the timeout is an optional flag that specifies the duration in seconds for which the call will wait for a job to arrive in the queue before returning (because the script can wait forever if no job come).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~128 days

Recently: every ~121 days

Total

8

Last Release

3946d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca21233cea84cc055bcc3678608a64bcf30b3da970a5fab96f54590ae3506125?d=identicon)[roelvanduijnhoven](/maintainers/roelvanduijnhoven)

![](https://www.gravatar.com/avatar/01a3e1034b26bd108985705a0e5292850bf1ee7d234d4676c8735d6feeebf85f?d=identicon)[koenkivits](/maintainers/koenkivits)

![](https://www.gravatar.com/avatar/9e3c74232d02a5fedbcef4650bac1d1103be292d4a013f6f9e692befcc9bb7ca?d=identicon)[bakura10](/maintainers/bakura10)

---

Top Contributors

[![bakura10](https://avatars.githubusercontent.com/u/1198915?v=4)](https://github.com/bakura10 "bakura10 (56 commits)")[![jbaez](https://avatars.githubusercontent.com/u/1777543?v=4)](https://github.com/jbaez "jbaez (2 commits)")[![basz](https://avatars.githubusercontent.com/u/143068?v=4)](https://github.com/basz "basz (1 commits)")[![roelvanduijnhoven](https://avatars.githubusercontent.com/u/91910?v=4)](https://github.com/roelvanduijnhoven "roelvanduijnhoven (1 commits)")

---

Tags

queuejobbeanstalkdzf2beanstalkpheanstalk

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/slm-queue-beanstalkd/health.svg)

```
[![Health](https://phpackages.com/badges/slm-queue-beanstalkd/health.svg)](https://phpackages.com/packages/slm-queue-beanstalkd)
```

###  Alternatives

[davidpersson/beanstalk

Minimalistic PHP client for beanstalkd.

200321.9k8](/packages/davidpersson-beanstalk)[pmatseykanets/artisan-beans

Easily manage your Beanstalkd job queues right from the Laravel artisan command

4482.1k](/packages/pmatseykanets-artisan-beans)[xobotyi/beansclient

PHP7.1+ client for beanstalkd work queue with no dependencies

9226.8k](/packages/xobotyi-beansclient)[wowo/wowo-queue-bundle

The WowoQueueBundle provides unified method for use queue systems, like Beanstalkd, RabbitMQ, flat files, database driven queues etc.

2228.0k1](/packages/wowo-wowo-queue-bundle)[phlib/beanstalk

Library for handling beanstalk connections.

1014.9k2](/packages/phlib-beanstalk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
