Download the PHP package daanbiesterbos/job-queue-bundle without Composer
On this page you can find all versions of the php package daanbiesterbos/job-queue-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daanbiesterbos/job-queue-bundle
More information about daanbiesterbos/job-queue-bundle
Files in daanbiesterbos/job-queue-bundle
Package job-queue-bundle
Short Description Allows to run and schedule Symfony console commands as background jobs.
License Apache-2.0
Homepage https://github.com/daanbiesterbos/JMSJobQueueBundle
Informations about the package job-queue-bundle
JMSJobQueueBundle
Installation
Register Bundle
Add the bundle to bundles.php:
Prepare Console Executable
Copy bin/console
to bin/job-queue
and use the JMSJobQueueBundle application instead the standard Symfony application.
Note that this is part of the original bundle. I would prefer a better solution that does not require an extra console. However, for now backward compatibility is more important considering the purpose of the fork.
Usage
Creating Jobs
Creating jobs is simple, you just need to persist an instance of Job
:
Adding Dependencies Between Jobs
If you want to have a job run after another job finishes, you can also achieve this quite easily:
Schedule Job
If you want to schedule a job :
Fine-grained Concurrency Control through Queues
If you would like to better control the concurrency of a specific job type, you can use queues: Queues allow you to enforce stricter limits as to how many jobs are running per queue. By default, the number of jobs per queue is not limited as such queues will have no effect (jobs would just be processed in the order that they were created in). To define a limit for a queue, you can use the bundle?s configuration:
__ Note: Queue settings apply for each instance of the jms-job-queue:run
command separately. There is no way to specify a global limit for all instances.
Prioritizing Jobs
By default, all jobs are executed in the order in which they are scheduled (assuming they are in the same queue). If you would like to prioritize certain jobs in the same queue, you can set a priority:
The priority is a simple integer - the higher the number, the sooner a job is executed.
Scheduled Jobs - JMSJobQueueBundle Documentation
This bundle also allows you to have scheduled jobs which are executed in certain intervals. This can either be achieved by implementing JMSJobQueueBundleCommandCronCommand
in your command, or implementing JMSJobQueueBundleCronJobScheduler
in a service and tagging the service with jms_job_queue.scheduler
.
The jobs are then scheduled with the jms-job-queue:schedule
command that is run as an additional background process. You can also run multiple instances of this command to ensure high availability and avoid a single point of failure.
Implement CronCommand
For common intervals, you can also use one of the provided traits:
Implement JobScheduler
This is useful if you want to run a third-party command or a Symfony command as a scheduled command via this bundle.
Links
- Documentation: Github Repository
- License: LICENSE
- Forked from: JMSJobQueueBundle
All versions of job-queue-bundle with dependencies
symfony/framework-bundle Version ^4.4
symfony/debug Version ^4.4
symfony/process Version ^4.4
doctrine/doctrine-bundle Version ^2
symfony/twig-bundle Version ^4.4
symfony/form Version ^4.4
symfony/validator Version ^4.4
symfony/intl Version ^4.4