PHPackages                             bushbaby/slmqueuedoctrine-postponablejobstrategy - 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. bushbaby/slmqueuedoctrine-postponablejobstrategy

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

bushbaby/slmqueuedoctrine-postponablejobstrategy
================================================

BsbPostponableJobStrategy is a strategy for the SlmQueueDoctrine ZF2 module that provides the ability for jobs to postpone their execution until other jobs have successfully been processed.

1.0.3(10y ago)1443MITPHPPHP &gt;=5.5

Since Feb 12Pushed 10y ago3 watchersCompare

[ Source](https://github.com/bushbaby/BsbPostponableJobStrategy)[ Packagist](https://packagist.org/packages/bushbaby/slmqueuedoctrine-postponablejobstrategy)[ Docs](https://github.com/bushbaby/BsbPostponableJobStrategy)[ RSS](/packages/bushbaby-slmqueuedoctrine-postponablejobstrategy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

BsbPostponableJobStrategy
=========================

[](#bsbpostponablejobstrategy)

BsbPostponableJobStrategy is a strategy for the [SlmQueueDoctrine](https://github.com/juriansluiman/SlmQueueDoctrine)ZF2 module that provides the ability for jobs to postpone their execution until other jobs have successfully been processed.

[![Latest Stable Version](https://camo.githubusercontent.com/5d48a33daba138c15d5be069588d0bfb0e401e5f6899089cbd967841c0248220/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f736c6d7175657565646f637472696e652d706f7374706f6e61626c656a6f6273747261746567792f762f737461626c652e737667)](https://packagist.org/packages/bushbaby/slmqueuedoctrine-postponablejobstrategy)[![Total Downloads](https://camo.githubusercontent.com/6ba1bc5a194e739b55fed8b831db6dd36934c0f5f8bc0625243e1458bc492a93/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f736c6d7175657565646f637472696e652d706f7374706f6e61626c656a6f6273747261746567792f646f776e6c6f6164732e737667)](https://packagist.org/packages/bushbaby/slmqueuedoctrine-postponablejobstrategy)[![Latest Unstable Version](https://camo.githubusercontent.com/fb37936db2715b00cfe7e2cae77bc93e0af1f463d219dc5c4a24199c4172564c/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f736c6d7175657565646f637472696e652d706f7374706f6e61626c656a6f6273747261746567792f762f756e737461626c652e737667)](https://packagist.org/packages/bushbaby/slmqueuedoctrine-postponablejobstrategy)[![License](https://camo.githubusercontent.com/b5452e9f63edd5459d34e2381dce9790e6c273edb45b9cb6a3ddba15cde94984/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f736c6d7175657565646f637472696e652d706f7374706f6e61626c656a6f6273747261746567792f6c6963656e73652e737667)](https://packagist.org/packages/bushbaby/slmqueuedoctrine-postponablejobstrategy)

[![Build Status](https://camo.githubusercontent.com/8ff9cbeff8ce85c3c50c697fa45acf802a7d4d2f5c91d2ab28c39e53604a5183/68747470733a2f2f7472617669732d63692e6f72672f62757368626162792f427362506f7374706f6e61626c654a6f6253747261746567792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bushbaby/BsbPostponableJobStrategy)[![Code Coverage](https://camo.githubusercontent.com/ec67c82169b7031843faea3a6672e9b56caa8785dca67c498941502892bd8f57/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62757368626162792f427362506f7374706f6e61626c654a6f6253747261746567792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bushbaby/BsbPostponableJobStrategy/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/41e1d2e4a54c2498f1408b0ba10e787945d5fcc4a35428a53cb36e9dbe80a9b8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62757368626162792f427362506f7374706f6e61626c654a6f6253747261746567792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bushbaby/BsbPostponableJobStrategy/?branch=master)

---

Rationale
---------

[](#rationale)

I needed a simple way to ensure a particular order of job processing. This is not a problem if you have just one worker as those jobs are executed in the order they where added to the queue (FIFO). However when multiple workers process multiple queue's this can't be garanteed anymore.

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

[](#installation)

BsbPostponableJobStrategy requires Composer. To install it into your project, just add the following line into your composer.json file:

```
composer.phar require "bushbaby/slmqueuedoctrine-postponablejobstrategy:~1.0"

```

Enable the module by adding BsbPostponableJobStrategy in your application.config.php file.

Configuration
-------------

[](#configuration)

By enabling this module a new strategy is registered into the strategy manager of SlmQueue. You should then enable it by adding it some configuration to the appropiate worker queues. A suggested place is the slm\_queue.global.php in your autoload configuration directory.

example: enabled the PostponableJobStrategy for the queue called default with a release delay of 30 seconds

```
'worker_strategies' => array(
    'default' => array( // per worker
    ),
    'queues' => array( // per queue
        'default' => array(
            'BsbPostponableJobStrategy\Strategy\PostponableJobStrategy' => array(
                'release_delay' => 30
            ),
        ),
    ),
),

```

### PostponableJobStrategy

[](#postponablejobstrategy)

The PostponableJobStrategy accepts one option.

release\_delay (int) number of seconds used as delay option while releasing the job back into the queue this

Usage
-----

[](#usage)

The jobs that need to 'wait' with execution until some other job is done must implement the PostponableJobInterface. I suggest you use the provided PostponableJobTrait.

```
class MyJob extends SlmAbstractJob implements PostponableJobInterface
{
    use PostponableJobTrait;

    ...
}

```

Then while queueing Jobs you tell your postponable job about jobs that should be processed first:

```
$postponableJob     = $jobManager->get('MyJob')->setContent(...);

$job     = $jobManager->get('SomeJob')->setContent(...);
$queue->push($job);

$postponableJob->postponeUntil($job);

$queue->push($postponableJob);

```

### Known limitation

[](#known-limitation)

SlmQueueDoctrine has specific queue options (deleted\_lifetime and buried\_lifetime) to delete jobs from the database when they have been processed. When this lifetime is immediate (or very short) it (might) becomes impossible to get the status of a processed job. We therefore assume it has been successfully executed and therefore the current job execution is not postponed.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~146 days

Total

4

Last Release

3669d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.4

1.0.3PHP &gt;=5.5

### Community

Maintainers

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

---

Top Contributors

[![basz](https://avatars.githubusercontent.com/u/143068?v=4)](https://github.com/basz "basz (15 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

modulezf2strategyslm-queue

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bushbaby-slmqueuedoctrine-postponablejobstrategy/health.svg)

```
[![Health](https://phpackages.com/badges/bushbaby-slmqueuedoctrine-postponablejobstrategy/health.svg)](https://phpackages.com/packages/bushbaby-slmqueuedoctrine-postponablejobstrategy)
```

###  Alternatives

[zhuravljov/yii2-queue-monitor

Yii2 Queue Analytics Module

102203.2k](/packages/zhuravljov-yii2-queue-monitor)[thomasvargiu/rabbitmq-module

Integrates php-amqplib with Zend Framework 2 and RabbitMq

15143.0k1](/packages/thomasvargiu-rabbitmq-module)

PHPackages © 2026

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