library queue
Simple queue package for Laravel 5
nztim/queue
Simple queue package for Laravel 5
- Wednesday, March 29, 2017
- by nztim
- Repository
- 1 Watchers
- 0 Stars
- 228 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 26 Versions
- 2 % Grown
Queue Manager
Command bus queue package for Laravel 6. Executes commands using nztim/commandbus., (*1)
Installation
composer require nztim/queue
- Add
NZTim\Queue\QueueServiceProvider::class, to config/app.php
- Run
php artisan qm:migration && php artisan migrate to add the queue table
Usage
-
$qm->add($command) will add a command to the queue.
-
php artisan qm:process will process all jobs in the queue.
- Job failures will be logged as warnings, and final failures as errors.
- Queue processing is normally triggered via cron.
-
php artisan qm:daemon 50 processes the queue repeatedly for at least as long as the period specified (seconds).
- A lockfile is created in the storage folder to allow only only a single process to run.
- It is recommended to not use
withoutOverlapping() because if for any reason it's file mutex is not cleared then execution will halt indefinitely.
- A warning will be logged if queue processing is skipped. This may indicate a lot of jobs or slow execution.
- If something goes wrong and the lockfile is not cleared, it will time out after 20 minutes at which time normal processing will resume.
- Completed jobs are purged after 1 month.
-
php artisan qm:pause [10] pauses the queue for the specified number of minutes or until manually resumed.
-
php artisan qm:resume resumes paused queue processing if paused.
- Typically surround your deployments with
pause and resume
-
php artisan qm:logstatus logs queue statistics for the last 24 hours
Example Task Scheduler:, (*2)
$schedule->command('qm:daemon 50')->everyMinute();
$schedule->command('qm:logstatus')->dailyAt('4:00');
Other commands:
- php artisan qm:status [24] displays the queue status over the specified period (default 24 hours)
- php artisan qm:list [7] lists all jobs within the specified number of days
- php artisan qm:failed lists all failed jobs
- php artisan qm:dump {id} dumps contents of a particular job id
- php artisan qm:retry {id} retry failed job one more time
- php artisan qm:clear clears failed jobs from the queue, (*3)
Changelog
- 9.0: Update to PHP 7.4 syntax
- 8.0: Move to execution via command bus, remove use of Eloquent, major revision.
- 7.0: Remove facade and .env entries.
- 6.4: Add retry command
- 6: Replace cache lock with lockfile. Add
resume() method.
- To upgrade: add
resume to deployment scripts after deployment is complete.
- 5: Add
daemon() method for faster processing. Add pause() for reliable deployments.
- To upgrade: replace use
daemon via cron instead of process, add daily logstatus cron, update deployment process to use pause 10 followed by cache clear on completion
- 4:
-
QueueMgr::check() removed as is use of withoutOverlapping()
-
QUEUEMGR_EMAIL and QUEUEMGR_MAX_AGE options removed
- To upgrade, just remove the unnecessary calls and .env options. Use your error handler (e.g. Logger) for email notifications of failures.
dev-master
9999999-dev
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
The Development Requires
v6.1
6.1.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
The Development Requires
v6.0.0
6.0.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
The Development Requires
v5.2.0
5.2.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v5.1.2
5.1.2.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v5.1.1
5.1.1.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v5.1.0
5.1.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v5.0.0
5.0.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v4.1.3
4.1.3.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v4.1.2
4.1.2.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v4.1.1
4.1.1.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v4.1.0
4.1.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v4.0.0
4.0.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v3.0.1
3.0.1.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v3.0
3.0.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v2.0.1
2.0.1.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v2.0
2.0.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.5
1.5.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.4.5
1.4.5.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.4.2
1.4.2.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.4.1
1.4.1.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.4
1.4.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.2
1.2.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.1
1.1.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v1.0
1.0.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires
v0.1.0
0.1.0.0
Simple queue package for Laravel 5
Sources
Download
MIT
The Requires