PHPackages                             david-garcia/php-resque-scheduler - 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. david-garcia/php-resque-scheduler

Abandoned → [symfony/messenger](/?search=symfony%2Fmessenger)ArchivedLibrary

david-garcia/php-resque-scheduler
=================================

Fork of chrisboulton/php-resque-scheduler with some updates that I needed for another project

1.1.2(8y ago)01.7k1MITPHP

Since Mar 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/DavidGarciaCat/php-resque-scheduler)[ Packagist](https://packagist.org/packages/david-garcia/php-resque-scheduler)[ RSS](/packages/david-garcia-php-resque-scheduler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

php-resque-scheduler: PHP Resque Scheduler
==========================================

[](#php-resque-scheduler-php-resque-scheduler)

php-resque-scheduler is a PHP port of [resque-scheduler](http://github.com/defunkt/resque), which adds support for scheduling items in the future to Resque.

The PHP port of resque-scheduler has been designed to be an almost direct-copy of the Ruby plugin, and is designed to work with the PHP port of resque.

At the moment, php-resque-scheduler only supports delayed jobs, which is the ability to push a job to the queue and have it run at a certain timestamp, or in a number of seconds. Support for recurring jobs (similar to CRON) is planned for a future release.

Because the PHP port is almost a direct API copy of the Ruby version, it is also compatible with the web interface of the Ruby version, which provides the ability to view and manage delayed jobs.

Please note
-----------

[](#please-note)

This is a fork with some minor adjustments that I needed to apply for another project.

Delayed Jobs
------------

[](#delayed-jobs)

To quote the documentation for the Ruby resque-scheduler:

> Delayed jobs are one-off jobs that you want to be put into a queue at some point in the future. The classic example is sending an email:

```
require 'Resque/Resque.php';
require 'ResqueScheduler/ResqueScheduler.php';

$in = 3600;
$args = array('id' => $user->id);
ResqueScheduler::enqueueIn($in, 'email', 'SendFollowUpEmail', $args);

```

The above will store the job for 1 hour in the delayed queue, and then pull the job off and submit it to the `email` queue in Resque for processing as soon as a worker is available.

Instead of passing a relative time in seconds, you can also supply a timestamp as either a DateTime object or integer containing a UNIX timestamp to the `enqueueAt` method:

```
require 'Resque/Resque.php';
require 'ResqueScheduler/ResqueScheduler.php';

$time = 1332067214;
ResqueScheduler::enqueueAt($time, 'email', 'SendFollowUpEmail', $args);

$datetime = new DateTime('2012-03-18 13:21:49');
ResqueScheduler::enqueueAt($datetime, 'email', 'SendFollowUpEmail', $args);

```

NOTE: resque-scheduler does not guarantee a job will fire at the time supplied. At the time supplied, resque-scheduler will take the job out of the delayed queue and push it to the appropriate queue in Resque. Your next available Resque worker will pick the job up. To keep processing as quick as possible, keep your queues as empty as possible.

Worker
------

[](#worker)

Like resque, resque-scheduler includes a worker that runs in the background. This worker is responsible for pulling items off the schedule/delayed queue and adding them to the queue for resque. This means that for delayed or scheduled jobs to be executed, the worker needs to be running.

A basic "up-and-running" resque-scheduler.php file is included that sets up a running worker environment is included in the root directory. It accepts many of the same environment variables as php-resque:

- `REDIS_BACKEND` - Redis server to connect to
- `LOGGING` - Enable logging to STDOUT
- `VERBOSE` - Enable verbose logging
- `VVERBOSE` - Enable very verbose logging
- `INTERVAL` - Sleep for this long before checking scheduled/delayed queues
- `APP_INCLUDE` - Include this file when starting (to launch your app)
- `PIDFILE` - Write the PID of the worker out to this file

The resque-scheduler worker requires resque to function. The demo resque-scheduler.php worker allows you to supply a `RESQUE_PHP` environment variable with the path to Resque.php. If not supplied and resque is not already loaded, resque-scheduler will attempt to load it from your include path (`require_once 'Resque/Resque.php';'`)

It's easy to start the resque-scheduler worker using resque-scheduler.php: $ RESQUE\_PHP=../resque/lib/Resque/Resque.php php resque-scheduler.php

Event/Hook System
-----------------

[](#eventhook-system)

php-resque-scheduler uses the same event system used by php-resque and exposes the following events.

### afterSchedule

[](#afterschedule)

Called after a job has been added to the schedule. Arguments passed are the timestamp, queue of the job, the class name of the job, and the job's arguments.

### beforeDelayedEnqueue

[](#beforedelayedenqueue)

Called immediately after a job has been pulled off the delayed queue and right before the job is added to the queue in resque. Arguments passed are the queue of the job, the class name of the job, and the job's arguments.

Contributors
------------

[](#contributors)

- chrisboulton
- rayward
- atorres757
- tonypiper
- biinari
- cballou

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

3

Last Release

3077d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62c1db3c19dedf826fe3b41a2fa2df2cc65ec69bd0f388b9854c624e85af5fa4?d=identicon)[DavidGarciaCat](/maintainers/DavidGarciaCat)

---

Top Contributors

[![chrisboulton](https://avatars.githubusercontent.com/u/98472?v=4)](https://github.com/chrisboulton "chrisboulton (14 commits)")[![DavidGarciaCat](https://avatars.githubusercontent.com/u/7809429?v=4)](https://github.com/DavidGarciaCat "DavidGarciaCat (5 commits)")[![robholmes](https://avatars.githubusercontent.com/u/206717?v=4)](https://github.com/robholmes "robholmes (4 commits)")[![rayward](https://avatars.githubusercontent.com/u/1217111?v=4)](https://github.com/rayward "rayward (3 commits)")[![mhagstrand](https://avatars.githubusercontent.com/u/685532?v=4)](https://github.com/mhagstrand "mhagstrand (1 commits)")[![smalot](https://avatars.githubusercontent.com/u/1424035?v=4)](https://github.com/smalot "smalot (1 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")[![biinari](https://avatars.githubusercontent.com/u/148009?v=4)](https://github.com/biinari "biinari (1 commits)")[![tonypiper](https://avatars.githubusercontent.com/u/206124?v=4)](https://github.com/tonypiper "tonypiper (1 commits)")[![cballou](https://avatars.githubusercontent.com/u/166784?v=4)](https://github.com/cballou "cballou (1 commits)")[![danhunsaker](https://avatars.githubusercontent.com/u/1534396?v=4)](https://github.com/danhunsaker "danhunsaker (1 commits)")[![JaapRood](https://avatars.githubusercontent.com/u/857549?v=4)](https://github.com/JaapRood "JaapRood (1 commits)")

### Embed Badge

![Health badge](/badges/david-garcia-php-resque-scheduler/health.svg)

```
[![Health](https://phpackages.com/badges/david-garcia-php-resque-scheduler/health.svg)](https://phpackages.com/packages/david-garcia-php-resque-scheduler)
```

PHPackages © 2026

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