cekta / queue
Queue abstraction
dev-master
2026-07-26 22:21 UTC
Requires
- php: >=8.3
Requires (Dev)
- phpstan/phpstan: @stable
- squizlabs/php_codesniffer: @stable
- testo/testo: ^0.10.8
This package is auto-updated.
Last update: 2026-07-26 22:22:08 UTC
README
A minimalist, type-safe, and atomic state-machine queue component for modern PHP applications.
Key Features
- Atomic Consumption: Pull-based consumer architecture that handles exactly one task per invocation, eliminating forced infinite loops inside the library.
- Strictly Typed DTOs: Producers accept
JsonSerializableobjects, guaranteeing predictable and structured payload serialization. - Stalled Worker Protection: Built-in tools to detect and recover from crashed or timed-out workers.
- No Invisible Retries: Handlers own their business context and can explicitly dispatch new messages if a retry policy is needed, avoiding accidental side effects.
Architecture Architecture Overview
The library separates concerns into six core contracts:
Status— Predictable state machine for task lifecycles.Task— Read-only representation of the queued job metadata and decoded payload.Producer— Dispatches strongly-typed objects into the queue storage.Handler— Encapsulates isolated business logic.Consumer— An atomic worker that fetches and executes a single task.StaleCleaner— A maintenance service to release timed-out processes.