Table Of Contents


You can obtain free community support for example through stackoverflow, or also through the Symfony2 mailing list.

If you think you found a bug, please create a ticket in the bug tracker.

Continuous Inspections

If you take code quality seriously, try out the new continuous inspection service.



Creating Jobs

Creating jobs is super simple, you just need to persist an instance of Job:


$job = new Job('my-symfony2:command', array('some-args', 'or', '--options="foo"'));

Adding Dependencies Between Jobs

If you want to have a job run after another job finishes, you can also achieve this quite easily:


$job = new Job('a');
$dependentJob = new Job('b');

Schedule a Jobs

If you want to schedule a job :


$job = new Job('a');
$date = new DateTime();
$date->add(new DateInterval('PT30M'));

Fine-grained Concurrency Control through Queues

If you would like to better control the concurrency of a specific job type, you can use queues:


$job = new Job('a', array(), true, "aCoolQueue");

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:

        max_concurrent_jobs: 3 # This limit applies to all queues (including the default queue).
                               # So each queue may only process 3 jobs simultaneously.

            max_concurrent_jobs: 2 # This limit applies only to the "foo" queue.
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:

$job = new Job('a', array(), true, Job::DEFAULT_QUEUE, Job::PRIORITY_HIGH);

The priority is a simple integer - the higher the number, the sooner a job is executed.