PHPackages                             remq/remq - 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. [Caching](/categories/caching)
4. /
5. remq/remq

AbandonedArchivedLibrary[Caching](/categories/caching)

remq/remq
=========

Redis-backed Queue Service

v0.0.2(13y ago)115MITPHPPHP &gt;=5.3.0

Since Nov 21Pushed 13y ago1 watchersCompare

[ Source](https://github.com/mloberg/ReMQ)[ Packagist](https://packagist.org/packages/remq/remq)[ RSS](/packages/remq-remq/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

ReMQ
====

[](#remq)

[![Build Status](https://camo.githubusercontent.com/01b4e9c8d3406b58ece4f52e2c88b0d061e4a563672a466aff3333d954c871f3/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d6c6f626572672f52654d512e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mloberg/ReMQ)

Redis Message Queue (ReMQ) is a message queue built on top of the awesome Redis key-value store.

Getting ReMQ
------------

[](#getting-remq)

ReMQ is published on [Packagist](https://packagist.org/packages/remq/remq), so you can install it using [Composer](http://getcomposer.org/).

```
"require": {
	"remq/remq": "version"
}

```

Jobs
----

[](#jobs)

Jobs are stored as classes. The class must have a perform method which can take a variable number of parameters.

```
class JobClass
{

	static function perform($param1, $param2)
	{
		echo "Ran job with {$param1} and {$param2}.";
	}

}

```

Queuing Jobs
------------

[](#queuing-jobs)

Instead of creating a queue for each job, ReMQ allows multiple jobs per queue. This is for simplicity's sake, and there is no other reason behind it.

```
$queue = new ReMQ\Queue('name');
$queue->enqueue(JobClass, 'param1', 'param2');

```

Processing Jobs
---------------

[](#processing-jobs)

To process a job, you need to create a worker for the queue.

```
$worker = new ReMQ\Worker('name');

```

You can also add additional queues to process.

```
$worker->addQueue('other');

```

You can also match queue names.

```
$worker->addQueue('*');
$worker->addQueue('namespaced:*');

```

To run the worker, you will call *run*, *runTime*, *runCount*, or *runForever*.

```
$worker->runTime(60); // run the worker for 60 seconds. REMQ_RUN_TIME
$worker->runCount(10); // run 10 jobs. REMQ_RUN_COUNT
$worker->runForever(); // run until the script is killed. REMQ_RUN_FOREVER
$worker->run(REMQ_RUN_TYPE, [$unit]); // default is REMQ_RUN_FOREVER

```

Failing Jobs
------------

[](#failing-jobs)

If an exception is thrown when a job is being processed, the job will be re-enqueued, and the exception rethrown.

```
try {
	$worker->runForever();
} Catch (Exception $e) {
	echo $e->getMessage();
}

```

#### TODO:

[](#todo)

- Handle errors.

Redis
-----

[](#redis)

ReMQ is using [Predis](https://github.com/nrk/predis) to connect with Redis. By default Predis will connect to 127.0.0.1 on port 6379. If you are running Redis on another machine, or a non-standard port, you can define that using the setRedisConfig method.

```
$queue->setRedisConfig(array(
	'host' => '10.0.0.1'
));

```

If Redis has an auth password, you will need to call the auth command before queuing or processing any jobs.

```
$queue->redis()->auth('your-pass');

```

Contributing
------------

[](#contributing)

If you have made any changes or modifications (and passing tests) to ReMQ, please open a pull request. I would love to have it included in the official package.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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 ~0 days

Total

2

Last Release

4971d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b7bb02bd7aebd8ca0d722ceb4162a00dc9b0e523ce9b5eb7b88d8fef6bff43f?d=identicon)[mloberg](/maintainers/mloberg)

---

Tags

redisqueuemessage queue

### Embed Badge

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

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

###  Alternatives

[mjphaynes/php-resque

Redis backed library for creating background jobs and processing them later.

228201.4k2](/packages/mjphaynes-php-resque)[pdffiller/qless-php

PHP Bindings for qless

29113.7k2](/packages/pdffiller-qless-php)[spinx/sidekiq-job-php

Push and schedule jobs to Sidekiq from PHP

37236.2k](/packages/spinx-sidekiq-job-php)[kevindees/laravel-redis-queue

Redis queue managment for laravel.

1634.1k](/packages/kevindees-laravel-redis-queue)

PHPackages © 2026

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