kinetis/queue

A backend-agnostic background job queue for Kinetis — Redis and SQL (MySQL/Postgres) backends included, no fluent job-scheduling DSL.

Maintainers

Package info

github.com/kinetis-dev/queue

pkg:composer/kinetis/queue

Transparency log

Statistics

Installs: 19

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

v1.2.0 2026-08-16 08:57 UTC

This package is auto-updated.

Last update: 2026-08-16 08:57:34 UTC


README

Kinetis

kinetis/queue
A backend-agnostic background job queue for Kinetis

Packagist Version Packagist Downloads PHP Version License CI

Redis and SQL (MySQL/Postgres) backends included, behind one Kinetis\Queue\QueueInterface — push a job from application code, a separate kinetis queue:work worker process pops and runs it. Named, priority-ordered queues, bounded retries (maxAttempts, defaulting to no retries at all), and named connections come built in. Amazon SQS is a third backend, in the separate kinetis/queue-sqs.

use Kinetis\Queue\Job;
use Kinetis\Queue\QueueInterface;

final readonly class SendWelcomeEmail implements Job
{
    public function __construct(
        public string $email,
        public string $name,
    ) {}

    public function handle(Mailer $mailer): void
    {
        $mailer->send($this->email, "Welcome, {$this->name}!");
    }
}

$queue->push(new SendWelcomeEmail($email, $name), maxAttempts: 3);
vendor/bin/kinetis queue:work --queue=high,default

Provides

Installing this package is what opts it in — it registers the following automatically, through the extra.kinetis declaration in its composer.json (see docs.kinetis.dev/cli.html):

  • Command: queue:work on vendor/bin/kinetis — the worker loop.
  • Service binding: with QUEUE_CONNECTION set, QueueInterface is bound to the selected backend before your own bootstrap.php runs — your registration wins on the same binding. Inert when QUEUE_CONNECTION is unset.

Nothing else — no routes, middleware, event listeners, or MCP tools.

Configuration

Read from the environment (or .env) via Kinetis\Config — by kinetis queue:work and by this package's bootstrap, which binds QueueInterface to the selected backend with no application wiring. The backend's own connection details come from the keys that backend already documents: REDIS_* (kinetis/cache-redis's convention), DB_* (kinetis/persistence), or the QUEUE_SQS_*/QUEUE_RABBITMQ_* keys in kinetis/queue-sqs/kinetis/queue-rabbitmq.

Key Default Purpose
QUEUE_CONNECTION (required) redis, sql, sqs (needs kinetis/queue-sqs), or rabbitmq (needs kinetis/queue-rabbitmq).
QUEUE_CONNECTION_NAME default Which named REDIS_*/DB_* block the backend uses.
QUEUE_MAX_ATTEMPTS 0 Worker-level default attempts cap (0 = no retries); a job's own push(maxAttempts: ...) wins.
QUEUE_POLL_TIMEOUT 5 Seconds per pop() wait.
QUEUE_VISIBILITY_TIMEOUT_SECONDS SQL backend only (scoped): reclaim a crashed worker's reserved job after this long; unset means never.

Full reference across every package: docs.kinetis.dev/config.html.

Installation

composer require kinetis/queue

Requires PHP 8.4+ and kinetis/framework. Full documentation: docs.kinetis.dev/queue.html.

License

MIT — see LICENSE.