Download the PHP package mcfedr/doctrine-delay-queue-driver-bundle without Composer
On this page you can find all versions of the php package mcfedr/doctrine-delay-queue-driver-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package doctrine-delay-queue-driver-bundle
Doctrine Delay Queue Driver Bundle
A driver for Queue Manager Bundle that uses Doctrine to store delayed jobs
This driver doesn't run jobs, it requires another driver to actually process jobs.
It currently only works with MySQL as a native query is required to find jobs in a concurrency safe way.
Usage
You should run the daemon for delay in addition to any other daemons you are using. This runner simply moves jobs from Doctrine into your other job queues. Because its not doing much work generally a single instance can cope with a high number of jobs.
Where {name}
is what you used in the config. Add -v
or more to get detailed logs.
Install
Composer
composer require mcfedr/doctrine-delay-queue-driver-bundle
AppKernel
Include the bundle in your AppKernel
public function registerBundles()
{
$bundles = [
...
new Mcfedr\QueueManagerBundle\McfedrQueueManagerBundle(),
new Mcfedr\DoctrineDelayQueueDriverBundle\McfedrDoctrineDelayQueueDriverBundle(),
Config
With this bundle installed you can setup your queue manager config similar to this:
mcfedr_queue_manager:
managers:
delay:
driver: doctrine_delay
options:
entity_manager: default
default_manager: default
default_manager_options: []
This will create a QueueManager
service named "mcfedr_queue_manager.delay"
entity_manager
- Doctrine entity manager to usedefault_manager
- Default job processordefault_manager_options
- Default options to pass to job processorput
Options to QueueManager::put
time
- A\DateTime
object of when to schedule this jobdelay
- Number of seconds from now to schedule this jobmanager
- Use a different job processor for this jobmanager_options
- Options to pass to the processorsput
method
Note
If delay
or time
option is less then 30 seconds the job will be scheduled for immediate execution
Tables
After you have installed you will need to do a schema update so that the table of delayed tasks is created
All versions of doctrine-delay-queue-driver-bundle with dependencies
symfony/framework-bundle Version ^3.0|^4.0
mcfedr/queue-manager-bundle Version ^5.6.1
doctrine/doctrine-bundle Version ^1.6
doctrine/orm Version ^2.5
symfony/proxy-manager-bridge Version ^3.3|^4.0