A thin worker and producer client for the JoobQ SDK gateway of a self-hosted JoobQUI server: register jobs and
workflow blueprints, run their tasks with retries, heartbeats and graceful shutdown, and enqueue jobs (up to 500 in one
call with enqueueMany) or start workflows. With JoobQ Pro on the server: batches with completion callbacks (createBatch,
getBatch) and a shared sliding-window rate limit (rateLimit).
JoobQUI version 0.8.0; an SDK talks to a server of its own version or later.
- Requirements: PHP 8.1 or newer with the
curlandjsonextensions;pcntlfor graceful shutdown. - Install:
composer require azutoolkit/joobq. - Use: the namespace
JoobQ, loaded by Composer's autoloader (require 'vendor/autoload.php'). - Run: boot your application, then start
JoobQWorkerheadless in a process of its own; handlers use the application's own services. Withpcntlandposixloaded the worker always forks a pool (whateverconcurrencyis), each pool process a copy of the application made at the fork: open connections lazily or inonProcessStart: fn () => ..., which each pool process calls once before it takes tasks (like Resque'safter_fork). When it throws, that process logsjoobq: onProcessStart failed: <message>and ends without taking a task; its replacement starts after a pause that doubles from 0.25 s to 5 s, and after 5 such processes in a rowrun()throws. Withoutpcntlorposixthe worker runs one task at a time in its own process and does not callonProcessStart. - Connect: the server's origin and its SDK token, read by the examples from
JOOBQ_GATEWAY_URLandJOOBQ_SDK_TOKEN. - Documentation: https://www.joobq.io/docs/develop/ (workers, jobs, workflows, the gateway contract).
More about JoobQ: https://www.joobq.io
MIT (see LICENSE).