PHPackages                             sshilko/backq - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. sshilko/backq

ActiveLibrary[HTTP &amp; Networking](/categories/http)

sshilko/backq
=============

Background jobs processing with queue, workers &amp; publishers

3.0.2(4y ago)16663MITPHPPHP &gt;=7.2

Since Sep 25Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/sshilko/backq)[ Packagist](https://packagist.org/packages/sshilko/backq)[ Docs](https://github.com/sshilko/backq)[ RSS](/packages/sshilko-backq/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (8)Versions (24)Used By (0)

BackQ - Component
=================

[](#backq---component)

Background **queue processing** - publish tasks and process with workers, simplified.

- Sending [APNS](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9) push notifications (Legacy API)
- Sending [FCM](https://firebase.google.com/docs/cloud-messaging) push notifications to Android (GCM/FCM)
- Sending [AWS SNS](https://aws.amazon.com/sns/) push notifications via AWS SNS arn's
- Executing [Psr7\\Request](https://www.php-fig.org/psr/psr-7/) asynchronously via Guzzle
- Executing **any** processes with [symfony/process](http://symfony.com/doc/current/components/process.html)
- [Long delay scheduling](https://aws.amazon.com/blogs/aws/new-manage-dynamodb-items-using-time-to-live-ttl/) via DynamoSQS Adapter and Serialized worker, for reliable long-term scheduled jobs
- Extendable - write your own worker and use existing adapters out of the box ...

#### Installation

[](#installation)

```
#composer self-update && composer clear-cache && composer diagnose
composer require sshilko/backq:^3.0

```

#### Example with Redis adapter and `process` worker

[](#example-with-redis-adapter-and-process-worker)

```
#launch local redis
docker run -d --name=example-backq-redis --network=host redis

#install library in any folder for testing
mkdir /tmp/example && cd /tmp/example
composer require sshilko/backq:^3.0

#post job to queue (schedule)
cd vendor/sshilko/backq/example/publishers/process && php redis.php && cd /tmp/example

#[debug] connect
#[debug] _connect
#[debug] putTask
#[debug] putTask is connected and ready to: write
#[debug] putTask pushed task without delay xoOgPKcS9bIDVXSaLYH9aLB22gzzptRo
#[debug] putTask return 'xoOgPKcS9bIDVXSaLYH9aLB22gzzptRo'
#Published process message via redis adapter as ID=xoOgPKcS9bIDVXSaLYH9aLB22gzzptRo

#fetch job from queue (work)
cd vendor/sshilko/backq/example/workers/process && php redis.php && cd /tmp/example

#[debug] connect
#[debug] _connect
#[debug] pickTask
#[debug] pickTask blocking for 5 seconds until get a job
#[debug] pickTask reserved a job nOgykJV81g969yw2wRMF94V9KiIeKN4P
#[debug] afterWorkSuccess
#[debug] afterWorkSuccess currently 1 reserved job(s)
#[debug] afterWorkSuccess releasing completed nOgykJV81g969yw2wRMF94V9KiIeKN4P job
#[debug] Disconnecting
#[debug] Disconnecting, previously connected
#[debug] Disconnecting, state detected
#[debug] Disconnecting, state detected, queue is connected
#[debug] Disconnecting, state 0 jobs reserved and not finalized
#[debug] Disconnecting, state detected, disconnecting queue manager
#[debug] Disconnecting, successful

#verify job executed (example process worker does echo $( date +%s ) >> /tmp/test)
cat /tmp/test

docker stop example-backq-redis

```

#### Supported queue servers

[](#supported-queue-servers)

- [Beanstalkd](https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt)
- [Redis](https://redis.io)
- [NSQ](https://nsq.io)
- [DynamoDB](https://aws.amazon.com/dynamodb/) [SQS](https://aws.amazon.com/sqs/) [Lambda](https://aws.amazon.com/lambda/) for DynamoSQS adapter

#### Features

[](#features)

Workers compatibility with adapters

Adapter / Worker[FCM](https://firebase.google.com/docs/cloud-messaging)[APNS](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9)[Process](http://symfony.com/doc/current/components/process.html)[Guzzle](https://www.php-fig.org/psr/psr-7/)Serialized[AWS SNS](https://aws.amazon.com/sns/)[Closure](https://github.com/opis/closure)[Beanstalkd](https://beanstalkd.github.io/)+++++++[Redis](https://redis.io)++++?++[NSQ](https://nsq.io/)++++?+?[DynamoSQS](https://aws.amazon.com/)+++++?+Adapter implemented features

Adapter / FeaturepinghasWorkerssetWorkTimeout[Beanstalkd](https://beanstalkd.github.io/)+++[Redis](https://redis.io)+-+[NSQ](https://nsq.io/)+-\*[DynamoSQS](https://aws.amazon.com/)--+Worker available features

- `setRestartThreshold` (limit max number of jobs cycles, then terminate)
- `setIdleTimeout` (limit max idle time, then terminating)

TLDR

[![Backq](https://github.com/sshilko/backq/raw/master/example/example.jpg "Background tasks with workers and publishers via queues")](https://github.com/sshilko/backq/raw/master/example/example.jpg)

See [/example](https://github.com/sshilko/backq/tree/master/example) folder for usage examples

#### Old version 1 detailed review

[](#old-version-1-detailed-review)

[Blog post about sending Apple push notifications](http://moar.sshilko.com/2014/09/09/APNS-Workers/)

#### Licence

[](#licence)

MIT

Copyright 2013-2022 Sergei Shilko Copyright 2016-2019 Carolina Alarcon

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance50

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~121 days

Recently: every ~366 days

Total

23

Last Release

1587d ago

Major Versions

1.9.13 → 2.0.62019-09-19

2.0.7 → 3.0.22022-01-12

PHP version history (5 changes)1.0.0PHP &gt;=5.5.0

1.2.1PHP &gt;=7.0.2

1.3.0PHP &gt;=7.0.4

1.9.13PHP ^7.1

3.0.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/74fb0579a62a4158388bcf5a61a76922c7a3e7776217ea5fc33a87790011b17e?d=identicon)[sshilko](/maintainers/sshilko)

---

Top Contributors

[![sshilko](https://avatars.githubusercontent.com/u/1147808?v=4)](https://github.com/sshilko "sshilko (125 commits)")

---

Tags

apnsbeanstalkdclosuredynamodbfcmguzzlephpredissnssqsasyncdynamodbGuzzlepushprocessnotificationqueueFCMsendsqsbackgroundappleapnsworkerios

### Embed Badge

![Health badge](/badges/sshilko-backq/health.svg)

```
[![Health](https://phpackages.com/badges/sshilko-backq/health.svg)](https://phpackages.com/packages/sshilko-backq)
```

###  Alternatives

[sly/notification-pusher

Standalone PHP library for easy devices notifications push.

1.2k2.8M15](/packages/sly-notification-pusher)[mcfedr/awspushbundle

A set of services to simplify using Aws to send push notifications

40378.6k1](/packages/mcfedr-awspushbundle)[m2mobi/apns-php

Apple Push Notification &amp; Feedback Provider

1118.2k1](/packages/m2mobi-apns-php)

PHPackages © 2026

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