Download the PHP package daycry/jobs without Composer

On this page you can find all versions of the php package daycry/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

Donate


🚀 VIEW ONLINE DOCUMENTATION 🚀


Codeigniter Jobs

Docs Tests Static Analysis Code Style Composer Security Coverage status Downloads Monthly Downloads GitHub release (latest by date) GitHub stars GitHub license

Job scheduling and queue processing for CodeIgniter 4. Define work with a fluent, immutable builder, dispatch it to one of several queue backends (Sync, Database, Redis, Beanstalk, Azure Service Bus), and process it with a resilient worker featuring real timeouts, retries with backoff, signed envelopes, idempotency and per-queue handler allowlists.

v3.0 is a complete, single-architecture rewrite. The legacy mutable Job builder, the V1 Scheduler, the performance loggers and the QueueManager have been removed. See the Migration v1 → v3 guide if you are upgrading.

Installation · Quick Start · Handlers · Backends · Commands · Cron · Security

Configuration · Queues · CLI Commands · Retries · Architecture


Features

Installation

Run the package migrations (queue table, lease columns, history table):

Optionally publish the config so you can customise it under app/Config/Jobs.php:

Backend-specific extensions are optional and only needed for the backend you use:

Requires PHP ^8.2 and CodeIgniter 4. See Installation for details.

Quick Start

Define and dispatch a job with the fluent facade:

dispatch() enqueues the definition onto the configured default backend (Config\Jobs::$worker) and returns the backend-assigned id. Pass a name to target a specific backend, e.g. ->dispatch('redis').

To build a definition without enqueuing it (e.g. for tests), use toDefinition():

Resolve a backend directly when you need lower-level access:

Builder API

Jobs::define(string $handler, mixed $payload = null): JobBuilder opens the builder. Chain any of:

Method Purpose
named(string) Friendly name for logs/metrics.
queue(?string) Target queue; null lets the runner pick the first configured queue.
priority(int) Higher = sooner (backend-dependent). Default 5.
maxRetries(?int) Retries after the first attempt. Total runs = maxRetries + 1.
timeout(?int) Per-attempt timeout in seconds (falls back to defaultTimeout).
scheduledAt(DateTimeImmutable) Earliest run time.
singleInstance(bool) Prevent concurrent runs of the same job.
environments(...) Restrict to specific CI4 environments.
dependsOn(...) Names that must succeed first (scheduler only).
idempotencyKey(?string) Opt-in deduplication key.
enabled(bool) / disable() Toggle a definition on/off.

Scheduling helpers: cron(string), everyMinute(?int), everyXMinutes(int), hourly(), hourlyAt(int), daily(), dailyAt('HH:MM'), weekly(), monthly(), quarterly(), yearly().

Terminators: toDefinition(): JobDefinition and dispatch(?string $backend = null): string.

Handlers

A handler contains business logic only. It implements JobHandlerInterface and receives an immutable JobContext ( payload, name, queue, attempt, meta ):

Extend AbstractJobHandler to get no-op beforeRun() / afterRun() and implement only handle(). For typed payloads, extend TypedJobHandler: declare payloadType(): string and implement run(object $dto); the base class rehydrates the DTO from the JobContext payload (array, object or JSON string).

Built-in handler keys

Configured in Config\Jobs::$handlers:

Key Class Payload
command CommandHandler Non-empty spark command string, e.g. 'app:report'.
shell ShellHandler A string or argv array; executed via proc_open (no shell).
closure ClosureHandler A callable; sync backend only (closures do not survive serialization).
event EventHandler ['name' => string, 'data' => array].
url UrlHandler ['method' => string, 'url' => string, 'options' => array].

Queue Backends

All backends implement a single QueueBackend contract with lease semantics: enqueue, fetch (returns a lease), ack, nack(?delay), abandon, reapExpired. Delivery is at-least-once on every persistent backend, so handlers should be idempotent.

Name Class Notes
sync SyncBackend Runs inline at enqueue() time. Default. No worker needed.
database DatabaseBackend Persistent; FOR UPDATE SKIP LOCKED; reaped by jobs:queue:reap.
redis RedisBackend Reliable queue (RPOPLPUSH); reaped by jobs:queue:reap.
beanstalk BeanstalkBackend Native delayed retry; recovers leases natively.
serviceBus ServiceBusBackend Azure Service Bus peek-lock; recovers leases natively.

Backends are configured in Config\Jobs::$backends; the active default is Config\Jobs::$worker. See Queues.

CLI Commands

See CLI Commands for every option.

Scheduling (Cron)

Register recurring jobs in Config\Jobs::init(). Each define() returns the same fluent builder. Jobs that declare a queue() are enqueued; the rest run inline. enabled() / environments() are honoured, and dependsOn() produces a topological execution order.

Run the scheduler from your system cron every minute:

Security

Resilience

See Architecture.

Configuration

All options live in Config\Jobs (handlers, queueHandlers, backends, worker, queues, retry/backoff, timeouts, signing, rate limits, DLQ, backend-specific settings). See Configuration.

Testing

License

MIT © Daycry


All versions of jobs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
dragonmantank/cron-expression Version ^3.3
michalsn/codeigniter4-uuid Version ^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 daycry/jobs contains the following files

Loading the files please wait ...