{"id":37263115,"url":"https://github.com/zorac/php-resque-scheduler","last_synced_at":"2026-01-15T23:45:17.162Z","repository":{"id":57091920,"uuid":"171035535","full_name":"zorac/php-resque-scheduler","owner":"zorac","description":"An addon for php-resque that lets you queue jobs for execution some time in the future. Follows resque-scheduler.","archived":false,"fork":false,"pushed_at":"2020-11-06T10:51:15.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T14:04:37.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zorac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-16T18:13:29.000Z","updated_at":"2020-04-21T19:22:37.000Z","dependencies_parsed_at":"2022-08-22T20:41:04.471Z","dependency_job_id":null,"html_url":"https://github.com/zorac/php-resque-scheduler","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/zorac/php-resque-scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorac%2Fphp-resque-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorac%2Fphp-resque-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorac%2Fphp-resque-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorac%2Fphp-resque-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zorac","download_url":"https://codeload.github.com/zorac/php-resque-scheduler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorac%2Fphp-resque-scheduler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28473974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:27:41.514Z","status":"ssl_error","status_checked_at":"2026-01-15T21:54:47.910Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-15T23:45:16.515Z","updated_at":"2026-01-15T23:45:17.152Z","avatar_url":"https://github.com/zorac.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP Resque Scheduler\n====================\n\nphp-resque-scheduler is a PHP port of [resque-scheduler](https://github.com/defunkt/resque),\nwhich adds support for scheduling items in the future to Resque.\n\nThe PHP port of resque-scheduler has been designed to be an almost direct-copy\nof the Ruby plugin, and is designed to work with a PHP port of resque,\n[php-resque](https://github.com/zorac/php-resque).\n\nAt the moment, php-resque-scheduler only supports delayed jobs, which is the\nability to push a job to the queue and have it run at a certain timestamp, or\nin a number of seconds. Support for recurring jobs (similar to CRON) is planned\nfor a future release.\n\nBecause the PHP port is almost a direct API copy of the Ruby version, it is also\ncompatible with the web interface of the Ruby version, which provides the\nability to view and manage delayed jobs.\n\n## Delayed Jobs\n\nTo quote the documentation for the Ruby resque-scheduler:\n\n\u003e Delayed jobs are one-off jobs that you want to be put into a queue at some\npoint in the future. The classic example is sending an email:\n\n```php\n    require 'Resque/Resque.php';\n    require 'Resque/Scheduler.php';\n\n    $in = 3600;\n    $args = ['id' =\u003e $user-\u003eid];\n    Scheduler::enqueueIn($in, 'email', 'SendFollowUpEmail', $args);\n```\n\nThe above will store the job for 1 hour in the delayed queue, and then pull the\njob off and submit it to the `email` queue in Resque for processing as soon as\na worker is available.\n\nInstead of passing a relative time in seconds, you can also supply a timestamp\nas either a DateTime object or integer containing a UNIX timestamp to the\n`enqueueAt` method:\n\n```php\n    require 'Resque/Resque.php';\n    require 'Resque/Scheduler.php';\n\n    $time = 1332067214;\n    Scheduler::enqueueAt($time, 'email', 'SendFollowUpEmail', $args);\n\n    $datetime = new DateTime('2012-03-18 13:21:49');\n    Scheduler::enqueueAt($datetime, 'email', 'SendFollowUpEmail', $args);\n```\n`\nNOTE: resque-scheduler does not guarantee a job will fire at the time supplied.\nAt the time supplied, resque-scheduler will take the job out of the delayed\nqueue and push it to the appropriate queue in Resque. Your next available Resque\nworker will pick the job up. To keep processing as quick as possible, keep your\nqueues as empty as possible.\n\n## Worker\n\nLike resque, resque-scheduler includes a worker that runs in the background. This\nworker is responsible for pulling items off the schedule/delayed queue and adding\nthem to the queue for resque. This means that for delayed or scheduled jobs to be\nexecuted, the worker needs to be running.\n\nA basic \"up-and-running\" resque-scheduler.php file is included that sets up a\nrunning worker environment is included in the root directory. It accepts many\nof the same environment variables as php-resque:\n\n* `REDIS_BACKEND` - Redis server to connect to\n* `LOGGING` - Enable logging to STDOUT\n* `VERBOSE` - Enable verbose logging\n* `VVERBOSE` - Enable very verbose logging\n* `INTERVAL` - Sleep for this long before checking scheduled/delayed queues\n* `APP_INCLUDE` - Include this file when starting (to launch your app)\n* `PIDFILE` - Write the PID of the worker out to this file\n\nThe resque-scheduler worker requires resque to function. The demo\nresque-scheduler.php worker allows you to supply a `RESQUE_PHP` environment\nvariable with the path to Resque.php. If not supplied and resque is not already\nloaded, resque-scheduler will attempt to load it from your include path\n(`require_once 'Resque/Resque.php';'`)\n\nIt's easy to start the resque-scheduler worker using resque-scheduler.php:\n    $ RESQUE_PHP=../resque/lib/Resque/Resque.php php resque-scheduler.php\n\n## Event/Hook System\n\nphp-resque-scheduler uses the same event system used by php-resque and exposes\nthe following events.\n\n### afterSchedule\n\nCalled after a job has been added to the schedule. Arguments passed are the\ntimestamp, queue of the job, the class name of the job, and the job's arguments.\n\n### beforeDelayedEnqueue\n\nCalled immediately after a job has been pulled off the delayed queue and right\nbefore the job is added to the queue in resque. Arguments passed are the queue\nof the job, the class name of the job, and the job's arguments.\n\n## Contributors ##\n\n* chrisboulton -- original [php-resque-scheduler](https://github.com/chrisboulton/php-resque-scheduler/)\n* Wan Qi Chen (Kamisama) -- [php-resque-ex-schduler](https://github.com/wa0x6e/php-resque-ex-scheduler)\n* zorac -- this fork\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzorac%2Fphp-resque-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzorac%2Fphp-resque-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzorac%2Fphp-resque-scheduler/lists"}