Download the PHP package mcfedr/periodic-queue-driver-bundle without Composer

On this page you can find all versions of the php package mcfedr/periodic-queue-driver-bundle. 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 periodic-queue-driver-bundle

Periodic Queue Driver Bundle

A driver for Queue Manager Bundle that uses runs jobs periodically.

This driver doesn't run jobs, it requires another driver to actually process jobs.

Latest Stable Version License Build Status

Usage

There is no runner daemon for this driver as it just plugs into other drivers. Use it by putting jobs into this driver with the period option.

Install

Composer

composer require mcfedr/periodic-queue-driver-bundle

AppKernel

Include the bundle in your AppKernel

public function registerBundles()
{
    $bundles = [
        ...
        new Mcfedr\QueueManagerBundle\McfedrQueueManagerBundle(),
        new Mcfedr\PeriodicQueueDriverBundle\McfedrPeriodicQueueDriverBundle(),

Config

With this bundle installed you can setup your queue manager config similar to this:

mcfedr_queue_manager:
    managers:
        periodic:
            driver: periodic
            options:
                default_manager: delay
                default_manager_options: []

This will create a QueueManager service named "mcfedr_queue_manager.periodic"

Options to QueueManager::put

Explanation

Commands

There are two commands that can be used to investigate how well spread jobs will. A simple way to visualize is to pipe into feedgnuplot.

rand-add uses a naive implementation of just adding a random number of seconds to get the time for the next run:

./tests/console test:distribution:rand-add -v | feedgnuplot --histogram 0 --binwidth 60 --hardcopy "rand-add.png" --exit

periodic uses the bundle implementation:

./tests/console test:distribution:periodic -v | feedgnuplot --histogram 0 --binwidth 60 --hardcopy "periodic.png" --exit

Job Token

There is job_tokens argument which can help with job uniqueness.

Usage example

When put new periodic job, you get PeriodicJob object.

    $periodicJob = $this->manager->put('some_service', [
        'some_argument' => 'some_value',
    ], [
        'period' => 'some_seconds',
    ], 'periodic');

You can do $periodicJob->getToken() of it and store the token for job execution

While execution

 public function execute(array $arguments)
    {
        // Get the stored token
        ...

        if ($storedToken != $arguments['job_tokens']['token']) {
            throw new InvalidTokenException();
        }

        ...

        $storedToken = ($arguments['job_tokens']['next_token']);

        // Save stored token for next execition.
    }

Each job execution new token is generated so if some job duplication will appear only one will be executed and other jobs will fail


All versions of periodic-queue-driver-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
symfony/framework-bundle Version ^3.0|^4.0
mcfedr/queue-manager-bundle Version ^5.6.1
nesbot/carbon Version ^1|^2
ramsey/uuid 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 mcfedr/periodic-queue-driver-bundle contains the following files

Loading the files please wait ....