Download the PHP package italix/jobs without Composer

On this page you can find all versions of the php package italix/jobs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jobs

Italix Jobs

PHP Version

A database-backed queue and cron scheduling. Work is described now and run later, by a worker that cannot run it twice and does not lose it when it dies.

One dependency: psr/container, which is interface-only.


Writing a job

Ids in the payload, not objects. A payload carrying a whole record is stale by the time it runs.

name_code() is not the class name. It is what jobs:status groups by and what jobs:retry --name= matches, so renaming a class must not break either.

Why payload()/from_payload() and not serialize()

Two reasons, and the second is the serious one.

A serialized object carries its private properties by name. Rename one, or add a constructor argument, and every row already queued becomes unrestorable — silently, at 3am, for work somebody is waiting on.

And unserialize() on a value read back from a table instantiates whatever class the string names and runs its magic methods. Any path that can write to that table becomes remote code execution. A JSON payload plus an explicit factory can only ever produce the class the code asked for.


Running

One crontab entry drives everything:

jobs:work does one pass and exits — supervision belongs to cron or systemd, and a PHP process that runs for days accumulates every leak its dependencies have.

Watch jobs:status, not jobs:work. The worker exiting 0 only means the worker ran; a failed job is reported by jobs:status, which exits 1 when anything is in failed.


What happens when a job fails

throws error_c = threw, attempt counted, requeued after backoff
throws again, attempts exhausted state failed, stays until somebody looks
class missing or payload rejected error_c = unrestorable, failed immediately — retrying cannot help
worker dies mid-job reclaimed after the visibility timeout, error_c = stalled

Backoff doubles: 30s, 60s, 120s. A mail server that is down stays down for a while, and retrying it every second turns one outage into a thousand log lines.

Nothing is ever dropped. A job that stops existing is the queue equivalent of a validation rule that silently passes.


Scheduling

Declared in configuration, like routes and commands:

ix jobs:schedule --list prints them, which is only possible because there is a list.

Running the cron twice enqueues once. due() returns a deduplication key naming the job and the minute, and the store's unique index turns the second push into a no-op. The system crontab is not a precision instrument: a minute can fire twice, a catch-up run can replay, two hosts can both be scheduled. Nothing anywhere has to be careful.

That is also why the resolution is a minute and not a second — the key has to be stable across the whole window in which the cron might fire.

Cron syntax: five fields, with *, n, a-b, a,b,c and a step suffix on any of those. 0 and 7 both mean Sunday, because both spellings are in circulation.


Concurrency, in one paragraph

claim() selects a candidate and then updates it conditionally on it still being pending. If another worker got there first the update affects zero rows and this one looks again. No SELECT … FOR UPDATE, no transaction held open across the work — just an update that can only succeed once. That is why claiming is a method on JobStore rather than a sequence the caller assembles: a store that cannot do it atomically is a store that runs jobs twice.


Deliberately not


All versions of jobs with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
psr/container Version ^1.0 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package italix/jobs contains the following files

Loading the files please wait ...