PHPackages                             barracudanetworks/jobrunner - 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. barracudanetworks/jobrunner

ActiveLibrary

barracudanetworks/jobrunner
===========================

A library to create and run jobs in PHP.

1.0.0(7y ago)721.4k↑12.5%4MITPHPPHP &gt;=5.3.0

Since Dec 14Pushed 7y ago8 watchersCompare

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

READMEChangelog (6)Dependencies (5)Versions (25)Used By (0)

PHP Job Runner
==============

[](#php-job-runner)

[![Code Climate](https://camo.githubusercontent.com/f5831db56ef6bddf8ab60704a63ad8500525bfdf0231e575410e6cff432a6fc9/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6261727261637564616e6574776f726b732f6a6f6272756e6e65722f6261646765732f6770612e737667)](https://codeclimate.com/github/barracudanetworks/jobrunner) [![Build Status](https://camo.githubusercontent.com/d4162cd52b3d2db9f746d29fac7df5f5e808bb62696acbd3b9a686f48302ca57/68747470733a2f2f7472617669732d63692e6f72672f6261727261637564616e6574776f726b732f6a6f6272756e6e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/barracudanetworks/jobrunner) [![Test Coverage](https://camo.githubusercontent.com/3c4bc3ae8715dcea0b57355796bd3d7125a555d637ed7a49c29572ef35edb558/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6261727261637564616e6574776f726b732f6a6f6272756e6e65722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/barracudanetworks/jobrunner/coverage)

A library to make runnable jobs with PHP easy. The library also supports creating jobs that have children backed by our PHP Fork Daemon.

Usage
-----

[](#usage)

Create your jobs by extending `Job`, or the special `ForkingJob` class for work that will utilize forking children.

Instantiate `JobRunner`, and add your jobs using the `addJob(JobDefinition $definition)` method. Then execute the `run()` method in a loop to daemonize the process.

Try the example in the `examples` folder by running `php examples/jobrunner.php`.

Setting options
---------------

[](#setting-options)

- `new JobDefinition()` accepts 5 parameters: First, a required job class name (e.g. `Vendor\Package\Job::class` or `'Vendor\Package\Job'`). The next 4 are optional:
    - `enabled` may be set to `"false"` to disable the job. By default, it is set to "true".
    - `run_time` may be set to a time at which a job should be run (e.g. `"11:30"`).
    - `interval` may be set to an interval (in seconds) on which the job should run (e.g. `3600` to run every hour).
    - `max_run_time` may be set (in seconds) for preventing a job to run longer than a certain time (e.g. `86400` to stop running after a day)
- `JobRunner->addJob()` accepts one parameter: The previously defined `JobDefinition`
- To set the number of child workers in a forking job, and the number of work units they should process, override `__construct` in `ForkingJob` to set your own settings:
    - `$this->setNumChildren(int)` sets the max number of children your job can have.
    - `$this->setItemCount(int)` sets the amount of work each child should do. See `examples/ForkingComplimenter.php` for an example.
    - *Note*: You should still call `parent::__construct($logger)` before using the above methods.

Caveats
-------

[](#caveats)

- You need to specify `declare(ticks=1);` before inclusion of the fork-daemon library, otherwise signals wont be handled. This *must* be done in the main PHP file, as `declare(ticks=N);` only works for the file, and files included by the file, in which it is declared in. Reference: [PHP Documentation](http://php.net/manual/en/control-structures.declare.php#control-structures.declare.ticks)
- OSX and Windows are unsupported.

License
-------

[](#license)

Copyright 2015 Barracuda Networks, Inc. Licensed under the MIT License

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% 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 ~65 days

Recently: every ~236 days

Total

20

Last Release

2572d ago

Major Versions

0.4.7 → 1.0.02019-05-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/68572f07c1c45f2e0b5072c199860bc6020ed337589d0a0969bb6251c3526c25?d=identicon)[barracuda](/maintainers/barracuda)

---

Top Contributors

[![pvitaly](https://avatars.githubusercontent.com/u/2931505?v=4)](https://github.com/pvitaly "pvitaly (48 commits)")[![johnmaguire](https://avatars.githubusercontent.com/u/440033?v=4)](https://github.com/johnmaguire "johnmaguire (32 commits)")[![mrrsm](https://avatars.githubusercontent.com/u/1251354?v=4)](https://github.com/mrrsm "mrrsm (3 commits)")[![ibeals](https://avatars.githubusercontent.com/u/1107468?v=4)](https://github.com/ibeals "ibeals (2 commits)")[![bn-mvalentin](https://avatars.githubusercontent.com/u/117293755?v=4)](https://github.com/bn-mvalentin "bn-mvalentin (1 commits)")[![Meowvalent](https://avatars.githubusercontent.com/u/1269015?v=4)](https://github.com/Meowvalent "Meowvalent (1 commits)")[![Fashp](https://avatars.githubusercontent.com/u/5429385?v=4)](https://github.com/Fashp "Fashp (1 commits)")

---

Tags

phpcrondaemons

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M493](/packages/mpdf-mpdf)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[comgate/sdk

Comgate PHP SDK

13327.8k](/packages/comgate-sdk)[pmill/php-scheduler

Simple PHP task scheduler

1833.5k](/packages/pmill-php-scheduler)

PHPackages © 2026

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