Download the PHP package darkjest/deferq without Composer

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

DeferQ

Документация на русском (README.ru.md)

Async task manager for PHP 8.4 with built-in deduplication, result caching (PSR-16), and callback notifications. Submit heavy tasks (report generation, data exports, etc.), and DeferQ will ensure each unique task runs only once, cache results for subsequent requests, and notify your application when work is done.

Installation

For Redis queue support:

For RabbitMQ queue support:

Quick Start

1. Configure DeferQ

2. Register Task Handlers

3. Dispatch a Task

4. Poll for Status

5. Run the Worker

Or use the CLI worker:

Deduplication

DeferQ prevents duplicate execution of identical tasks using fingerprinting:

  1. When you call dispatch(), DeferQ generates a SHA-256 fingerprint from the task name and canonically sorted parameters.
  2. If a result for this fingerprint already exists in cache, it returns immediately with TaskStatus::Completed.
  3. If a task with this fingerprint is already pending or running, the existing task's receipt is returned — no new task is created.
  4. Only if no cached result and no active task exist, a new task is created and queued.

This means 100 users requesting the same report simultaneously will trigger only a single execution.

Parameter key ordering does not matter — ['a' => 1, 'b' => 2] and ['b' => 2, 'a' => 1] produce the same fingerprint.

Callbacks

Callbacks are invoked by the worker after a task completes and its result is saved to cache. Implement CallbackInterface for production use:

Chain multiple callbacks with CallbackChain:

Callback failures are caught and logged — they never crash the worker.

Custom Queue Adapter

Implement QueueAdapterInterface to use any queue backend:

CLI Worker Bootstrap

Create a worker-bootstrap.php file that returns a configured Worker instance:

Then run:

Signal Handling

The CLI worker handles SIGTERM and SIGINT for graceful shutdown. When a signal is received, the worker finishes processing the current task before exiting.

Author

DarkJest

License

MIT


All versions of deferq with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
psr/simple-cache Version ^3.0
psr/log Version ^3.0
ramsey/uuid Version ^4.7
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 darkjest/deferq contains the following files

Loading the files please wait ...