Download the PHP package queues/queue-manager without Composer
On this page you can find all versions of the php package queues/queue-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download queues/queue-manager
More information about queues/queue-manager
Files in queues/queue-manager
Package queue-manager
Short Description Manage queues and run jobs
License MIT
Homepage http://honzicek.com/queue
Informations about the package queue-manager
queue-manager
Queue management in PHP. Purpose of this library is to have basic queue management for common hosting. Cron job, that opens webpage in some interval is what will be enough. Is it possible to set max time limit for running jobs as many hosting services has limited execution time. Main goal was to run tasks in background that needs to run slow.
Useful when you do not have possibility to instal any queue management
Instalation
Add to project using composer
Usage
Create custom job. Just extend \Queue\Job and override run method. Run method returns transformed data.
Add Job to queue
When creating instance of QueeuManager, pass context and queue name. Context can be empty or array or some manager.
If you using some kind of framework, e.g. Symfony, you can use dependency injection to get instance of QueueManager.
To execute jobs in queue. Usecase is run this every minute.
If you want to run in loop.
You can set parametters to runner
$maxJobCount - how many jobs will run in one loop $maxJobTime - how long can run one loop cycle. This is useful if you running loop by calling weburl with cron job and page execution has execution time limit. $sleeptime - sleep time when run in loop
Using context to inject connection.
Browsing queues
Queue interface provides methosds to get list of queued Jobs