Download the PHP package slm/queue-doctrine without Composer

On this page you can find all versions of the php package slm/queue-doctrine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package queue-doctrine

SlmQueueDoctrine

Important notice

We decided to move onto Symfony Messenger and we are therefore not maintaining this repository anymore. Feel free to fork it and make it your own.

Latest Stable Version Latest Unstable Version

Created by Stefan Kleff

Requirements

Note: it's necessary require the doctrine package in composer.json file.

Installation

Run composer require slm/queue-doctrine.

If you have the laminas/laminas-component-installer package installed, it will ask you to enable the module (and SlmQueue), both in Laminas and Mezzio. Otherwise, add the module to the list:

Note: Don't forget install SlmQueue in you config file, which is required.

Documentation

Before reading SlmQueueDoctrine documentation, please read SlmQueue documentation.

Configuring the connection

You need to register a doctrine connection which SlmQueueDoctrine will use to access the database into the service manager. Here are some examples.

Connection parameters can be defined in the application configuration:

Creating the table from SQL file

You must create the required table that will contain the queue's you may use the schema located in 'data/queue_default.sql'. If you change the table name look at Configuring queues

Creating the table from Doctrine Entity

There is an alternative way to create 'queue_default' table in your database by copying Doctrine Entity 'date/DefaultQueue.php' to your entity folder ('Application\Entity' in our example) and executing Doctrine's 'orm:schema-tool:update' command which should create the table for you. Notice that DefaultQueue entity is only used for table creation and is not used by this module internally.

Adding queues

Adding jobs

Configuring queues

The following options can be set per queue ;

Provided Worker Strategies

In addition to the provided strategies by SlmQueue SlmQueueDoctrine comes with these strategies;

ClearObjectManagerStrategy

This strategy will clear the ObjectManager before execution of individual jobs. The job must implement the DoctrineModule\Persistence\ObjectManagerAwareInterface or SlmQueueDoctrine\Persistence\ObjectManagerAwareInterface.

listens to:

options:

This strategy is enabled by default.

IdleNapStrategy

When no jobs are available in the queue this strategy will make the worker wait for a specific amount time before quering the database again.

listens to:

options:

This strategy is enabled by default.

Operations on queues

push

Valid options are:

Examples:

Worker actions

Interact with workers from the command line from within the public folder of your Laminas Framework 2 application

Starting a worker

Start a worker that will keep monitoring a specific queue for jobs scheduled to be processed. This worker will continue until it has reached certain criteria (exceeds a memory limit or has processed a specified number of jobs).

vendor/bin/laminas slm-queue:start <queueName>

A worker will exit when you press cntr-C after it has finished the current job it is working on. (PHP doesn't support signal handling on Windows)

Recovering jobs

To recover jobs which are in the 'running' state for prolonged period of time (specified in minutes) use the following command.

vendor/bin/laminas slm-queue:doctrine:recover <queueName> [--executionTime=]

Note : Workers that are processing a job that is being recovered are NOT stopped.


All versions of queue-doctrine with dependencies

PHP Build Version
Package Version
Requires php Version ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
laminas/laminas-eventmanager Version ^3.4
laminas/laminas-router Version ^3.5
slm/queue Version ^3.1
doctrine/dbal Version ^3.1.2
doctrine/annotations Version ^1.8
laminas/laminas-config Version ^3.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package slm/queue-doctrine contains the following files

Loading the files please wait ....