PHPackages                             pmg/queue-pheanstalk - 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. pmg/queue-pheanstalk

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

pmg/queue-pheanstalk
====================

A pmg/queue driver implementation for Pheanstalk and Beanstalkd

v8.0.0(4mo ago)354.5k↓50%1Apache-2.0PHPPHP ^8.3CI passing

Since Aug 26Pushed 2mo ago11 watchersCompare

[ Source](https://github.com/AgencyPMG/queue-pheanstalk)[ Packagist](https://packagist.org/packages/pmg/queue-pheanstalk)[ RSS](/packages/pmg-queue-pheanstalk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (21)Used By (0)

pmg/queue-pheanstalk
====================

[](#pmgqueue-pheanstalk)

A driver for [pmg/queue](https://github.com/AgencyPMG/Queue) backed by [Pheanstalk](https://github.com/pda/pheanstalk) and [Beanstalkd](http://kr.github.io/beanstalkd/).

See the [pmg/queue readme](https://github.com/AgencyPMG/Queue/blob/master/README.md)for the documentation of how the queue system as a whole works.

See the [examples](https://github.com/AgencyPMG/queue-pheanstalk/tree/master/examples)directory for examples of how to glue everything together.

Quick Example
-------------

[](#quick-example)

[Pheanstalk](https://github.com/pda/pheanstalk) is a PHP library for interacting with [Beanstalkd](http://kr.github.io/beanstalkd/). `PheanstalkDriver` lets you take advantage of Beanstalkd as a queue backend.

```
use Pheanstalk\Pheanstalk;
use PMG\Queue\DefaultConsumer;
use PMG\Queue\Driver\PheanstalkDriver;
use PMG\Queue\Serializer\NativeSerializer;
use PMG\Queue\Serializer\SigningSerializer;

// ...

$serilizer = new NativeSerializer('this is the secret key');

$driver = new PheanstalkDriver(new \Pheanstalk\Pheanstalk('localhost'), $serializer, [
    // how long easy message has to execute in seconds
    'ttr'               => 100,

    // the "priority" of the message. High priority messages are
    // consumed first.
    'priority'          => 1024,

    // The delay between inserting the message and when it
    // becomes available for consumption
    'delay'             => 0,

    // The ttr for retries jobs
    'retry-ttr'         => 100,

    // the priority for retried jobs
    'retry-priority'    => 1024,

    // When jobs fail, they are "burieds" in beanstalkd with this priority
    'fail-priority'     => 1024,

    // A call to `dequeue` blocks for this number of seconds. A zero or
    // falsy value will block until a job becomes available
    'reserve-timeout'   => 10,
]);

// $handler instanceof PMG\Queue\MessageHandler
$consumer = new DefaultConsumer($driver, $handler);
```

Dealing with Failed Messages
----------------------------

[](#dealing-with-failed-messages)

By default, `PheanstalkDriver` will [bury](https://github.com/kr/beanstalkd/blob/b7b4a6a14b7e8d096dc8cbc255b23be17a228cbb/doc/protocol.txt#L291-L293)any message passed to `PheanstalkDriver::fail`. This is, generally, a good thing if there are no other accountability measures around your queue system.

That said, `pmg/queue` does nothing for you regarding *kicking* jobs back to a ready state. If there are other accountability measures around your queue implementation and you'd rather just delete failed messages after they've been retried, use a different `FailureStrategy`.

```
use Pheanstalk\Pheanstalk;
use PMG\Queue\DefaultConsumer;
use PMG\Queue\Driver\PheanstalkDriver;
use PMG\Queue\Driver\Pheanstalk\DeleteFailureStrategy;
use PMG\Queue\Serializer\NativeSerializer;

// ...

$serilizer = new NativeSerializer('this is the secret key');
$failureStrategy = new DeleteFailureStrategy();

$driver = new PheanstalkDriver(new \Pheanstalk\Pheanstalk('localhost'), $serializer, [
    // as above
], $failureStrategy);

// $handler instanceof PMG\Queue\MessageHandler
$consumer = new DefaultConsumer($driver, $handler);
```

Feel free to implement `PMG\Queue\Driver\Pheanstalk\FailureStrategy` if a different solution is needed.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance83

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 79.5% 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 ~245 days

Recently: every ~515 days

Total

15

Last Release

123d ago

Major Versions

2.0.0 → 3.0.0-RC12019-08-20

v3.0.0 → v5.0.0-BETA12020-03-31

v5.2.0 → v6.0.02023-01-12

v6.0.0 → v7.0.02025-06-12

v7.0.0 → v8.0.02026-01-15

PHP version history (7 changes)1.0.0PHP ~5.6|~7.0

2.0.0PHP ~7.0

3.0.0-RC1PHP ~7.2

v5.0.0-BETA1PHP ^7.3

v5.2.0PHP ^7.4 || ^8.0

v6.0.0PHP ^8.0

v7.0.0PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![chrisguitarguy](https://avatars.githubusercontent.com/u/1010392?v=4)](https://github.com/chrisguitarguy "chrisguitarguy (62 commits)")[![jrughani9](https://avatars.githubusercontent.com/u/108751272?v=4)](https://github.com/jrughani9 "jrughani9 (14 commits)")[![WebCu](https://avatars.githubusercontent.com/u/3429093?v=4)](https://github.com/WebCu "WebCu (2 commits)")

---

Tags

beanstalkdpheanstalkphppmg-queuepmg-queue-driverqueue

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pmg-queue-pheanstalk/health.svg)

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

###  Alternatives

[symfony/beanstalkd-messenger

Symfony Beanstalkd Messenger Bridge

19357.4k2](/packages/symfony-beanstalkd-messenger)[udokmeci/yii2-beanstalk

Yii2 Beanstalk Client at the top of Paul Annesley's pheanstalk

69125.3k3](/packages/udokmeci-yii2-beanstalk)[pmatseykanets/artisan-beans

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

4482.1k](/packages/pmatseykanets-artisan-beans)[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)[n0nag0n/simple-job-queue

A simple library for interfacing with other job queue providers that gives you plenty of flexibility. Currently supports MySQL

351.8k1](/packages/n0nag0n-simple-job-queue)

PHPackages © 2026

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