Implements concrete Queue for the doctrine work queue. Requires the packages flowpack/jobqueue-common to be installed.
Install the package using Composer:
composer require flowpack/jobqueue-doctrine
If not already installed, that will fetch its requirements, namely the
Now the queue can be configured like this:
Flowpack: JobQueue: Common: queues: 'some-queue': className: 'Flowpack\JobQueue\Doctrine\Queue\DoctrineQueue' executeIsolated: true options: defaultTimeout: 50 releaseOptions: priority: 512 delay: 120
The required tables can be created executing:
./flow queue:setup some-queue
The poll interval should be short enough to process messages in time, and long enough to minimize resource consumption for the database. Boost mode is a solution which automatically handles spikes by processing messages in quick succession. When no new messages appear for a specified time, boost mode is disabled again.
The frequency by which the queue loop will look for new messages is the
pollInterval. In boost mode, the option
boostTime defines the time since the last processed message
after which boost mode is deactivated again.
DoctrineQueue supports following options:
|defaultTimeout||integer||60||Number of seconds new messages are waited for before a timeout occurs, this is overridden by a "timeout" argument in the
|pollInterval||float||1||Number of seconds between SQL lookups for new messages|
|boostPollInterval||float||0.5||Number of seconds between SQL lookups for new messages when in "boost mode"|
|boostTime||float||10||Maximum number of seconds since last processed message to activate "boost mode"|
|tableName||string||flowpack_jobqueue_messages_||Name of the database table for this queue. By default this is the queue name prefixed with "flowpack_jobqueue_messages_"|
|backendOptions||array||-||Doctrine-specific connection params (see Doctrine reference)|
DoctrineQueue currently supports
SQLite backends. You can specify the backend via the
you omit this setting, the current connection will be re-used (i.e. the
currently active Flow database).
Additional options supported by
DoctrineQueue::submit () and the
|delay||integer||0||Number of seconds before a message is marked "ready" after submission. This can be useful to prevent premature execution of jobs (i.e. before entities are persisted)|
Additional options to be specified via
|delay||integer||0||Number of seconds before a message is marked "ready" after it has been released.|
This package is licensed under the MIT license
Pull-Requests are more than welcome. Make sure to read the Code Of Conduct.