Download the PHP package initphp/queue without Composer

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

InitPHP Queue

CI

The framework-less BabelQueue runtime for plain PHP — a polyglot queue worker for apps that have no Laravel queue or Symfony Messenger of their own.

InitPHP Queue gives a plain PHP / Slim / Mezzio application the piece babelqueue/php-sdk deliberately leaves to the framework: the consumer loop, retries with back-off and dead-letter routing, plus a database (PDO) transport the core SDK does not ship. It reuses the SDK's canonical { job, trace_id, data, meta, attempts } envelope, so the queue you produce and consume here is the same queue a Go, Python, Node or .NET service reads — messages are routed by a stable URN, never a PHP class name.

Where it sits

Layer babelqueue/php-sdk InitPHP Queue
Wire format / contract Canonical envelope, URN scheme, validation, dead-letter annotation (reuses it)
Producer EnvelopeCodec + a publish Transport Producer facade
Consumer loop — (left to the framework) Worker: reserve → route → ack / retry / dead-letter
Transports Redis & AMQP (publish only) Redis, AMQP and PDO (publish + consume)

Requirements

Installation

Quick start

1. Write a handler

A handler is mapped to a message URN, not to a PHP class name. Return to acknowledge; throw to fail (the worker retries, then dead-letters).

2. Produce a message

A Go or Python consumer subscribed to the same emails queue reads the identical envelope.

3. Run a worker

Build the worker in a small bootstrap file that the CLI loads:

Prefer to drive it from your own code? Skip the CLI and call the worker directly:

Transports

All three implement both the SDK's publish Transport and this package's ConsumerTransport, so one object both produces and consumes.

Retries, back-off and dead-letters

A failed message is re-queued with an incremented attempts and a back-off delay until WorkerOptions::$maxAttempts is reached; then it is annotated with a dead_letter block and moved to the dead-letter destination (<queue>:failed list on Redis, <queue>.failed queue on RabbitMQ, the *_failed table on PDO).

Delivery is at-least-once — make handlers idempotent, or let the worker do it for you (see below).

Idempotent consumption

Because delivery is at-least-once, a transport may hand the same message to a worker more than once (after a crash before the ack, a lapsed reservation, or a broker hiccup). The dispatcher can dedupe these redeliveries so a message is processed at most once — opt in by giving it an IdempotencyOptions:

With no options (the default) deduplication is off and the dispatcher behaves exactly as before — this is fully backward-compatible.

How it dedupes. Before running a handler the dispatcher derives a stable dedup key from the message and claims it; a key that is already recorded means the message was processed before, so the handler is skipped and the message is acknowledged and discarded. The key is only recorded after the handler succeeds — a handler that throws leaves the key free, so the at-least-once redelivery is retried as normal.

The key is derived, in order, from:

  1. a custom keyResolver you supply (fn (ReceivedMessage): ?string), else
  2. the producer-minted meta.id (the canonical message identity), else
  3. the trace_id.

A message with none of these has no stable identity and is processed without deduplication.

Bring your own store

InMemoryIdempotencyStore is correct for a single long-running worker but it is not shared between processes and does not survive a restart, so it cannot dedupe across the whole fleet. For that, back the InitPHP\Queue\Contracts\IdempotencyStore contract with a durable, atomic store — exactly how the InitPHP ecosystem treats Cache and Database backends as pluggable seams:

A PDO-backed store works the same way: claim() is an INSERT that fails on a unique key column (caught and reported as false), remember() upserts the row, and a processed_at/expires_at column drives the TTL.

Unknown-URN strategy

When a message arrives whose URN has no mapped handler, the dispatcher applies one of the four canonical BabelQueue strategies:

A malformed or unsupported-schema_version envelope is always quarantined (dead-lettered), never silently dropped.

Documentation

Full guides live in docs/:

Guide What it covers
Getting started Install, the three moving parts, your first producer + worker.
Envelope & URNs The wire format and how to name message URNs.
Handlers & routing Writing handlers, the HandlerMap, unknown-URN strategies.
The worker & retries The loop, WorkerOptions, back-off, limits, graceful shutdown, the CLI.
Dead-letter handling When messages are quarantined and how to inspect/replay them.
PDO transport Schema, production DDL, reservation semantics.
Redis transport Keys, the reliable-queue pattern, delayed retries.
RabbitMQ transport Properties, headers, retry/delay caveats.
Interoperability Consuming a Go/Python-produced message end to end.
Migrating from 1.x What changed and how to port 1.x jobs.

Migrating from 1.x

2.0 is a breaking rewrite. See UPGRADE-2.0.md and docs/migrating-from-v1.md.

Testing

Integration tests against real Redis/RabbitMQ/MySQL run in CI (and locally when the matching QUEUE_TEST_* environment variables are set).

Contributing

Fork, branch, add tests for your change, and open a pull request. All code is released under the MIT License.

Credits

License

Copyright © 2023–2026 InitPHP — released under the MIT License.


All versions of queue with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
babelqueue/php-sdk Version ^1.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 initphp/queue contains the following files

Loading the files please wait ...