flowpack/jobqueue-doctrine

Implements concrete Queue for the doctrine work queue. Requires the packages flowpack/jobqueue-common to be installed.

Installs: 165 032

Dependents: 4

Suggesters: 1

Security: 0

Stars: 6

Watchers: 4

Forks: 9

Open Issues: 0

Type:neos-package

3.3.0-beta.3 2024-03-07 13:40 UTC

This package is auto-updated.

Last update: 2024-11-07 15:10:57 UTC


README

A job queue backend for the Flowpack.JobQueue.Common package based on Doctrine.

Usage

Install the package using Composer:

composer require flowpack/jobqueue-doctrine

If not already installed, that will fetch its requirements, namely the jobqueue-common package.

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

Boost Mode

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 configured pollInterval. In boost mode, the option boostPollInterval is used instead. boostTime defines the time since the last processed message after which boost mode is deactivated again.

Specific options

The DoctrineQueue supports following options:

NOTE: The DoctrineQueue should work with any database supported by Doctrine DBAL. It has been tested on MySQL, PostgreSQL, SQL Server and SQLite. You can specify the backend via the backendOptions. If you omit this setting, the current connection will be re-used (i.e. the currently active Flow database).

Submit options

Additional options supported by JobManager::queue(), DoctrineQueue::submit() and the Job\Defer annotation:

Release options

Additional options to be specified via releaseOptions for the queue:

License

This package is licensed under the MIT license

Contributions

Pull-Requests are more than welcome. Make sure to read the Code Of Conduct.