2017 © Pedro Peláez
 

cradle-package cradle-queue

AMQ handler for Cradle

image

cradlephp/cradle-queue

AMQ handler for Cradle

  • Sunday, March 25, 2018
  • by cblanquera
  • Repository
  • 2 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 633 % Grown

The README.md

cradle-queue

RabbitMQ with Fork and Exec workers. Built for the Cradle Framework, (*1)

Install

If you already installed Cradle, you may not need to install this because it should be already included., (*2)

composer require cradlephp/cradle-queue
bin/cradle cradlephp/cradle-queue install

Setup

Open /config/services.php and add, (*3)

'rabbitmq-main' => [
    'host' => '127.0.0.1',
    'port' => 5672,
    'user' => 'guest',
    'pass' => 'guest'
],

Methods

cradle('cradlephp/cradle-queue')->queue(*string $event, array $data);

An easy way to queue., (*4)

cradle('cradlephp/cradle-queue')
    ->queue()
    ->setData(*array $data)
    ->setDelay(*string $delay)
    ->setPriority(*int $priority)
    ->setQueue(*string $queueName)
    ->setRetry(*int $retry)
    ->send(*string $task, bool $duplicates = true);

Returns the queue class for advance manipulation. If you want to prevent duplicates from entering your queue, set the $duplicates flag to false and turn on Redis (this is the only way I can figure this can happen)., (*5)

CommandLine

You can queue events via command line like the following example., (*6)

$ cradle queue event-name foo=bar zoo=foo

To start a worker use any of the following commands., (*7)

$ cradle work
$ cradle work --mode exec
$ cradle work --mode fork
  • cradle work --mode exec - Uses exec() to work on tasks. This is used incase you want to manage your background process
  • cradle work --mode fork - Uses pntl_fork to work on tasks. This is another way to manage your background process

# Contributing to Cradle PHP, (*8)

Thank you for considering to contribute to Cradle PHP., (*9)

Please DO NOT create issues in this repository. The official issue tracker is located @ https://github.com/CradlePHP/cradle/issues . Any issues created here will most likely be ignored., (*10)

Please be aware that master branch contains all edge releases of the current version. Please check the version you are working with and find the corresponding branch. For example v1.1.1 can be in the 1.1 branch., (*11)

Bug fixes will be reviewed as soon as possible. Minor features will also be considered, but give me time to review it and get back to you. Major features will only be considered on the master branch., (*12)

  1. Fork the Repository.
  2. Fire up your local terminal and switch to the version you would like to contribute to.
  3. Make your changes.
  4. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message"), (*13)

    Making pull requests

  5. Please ensure to run phpunit and phpcs before making a pull request., (*14)

  6. Push your code to your remote forked version.
  7. Go back to your forked version on GitHub and submit a pull request.
  8. All pull requests will be passed to Travis CI to be tested. Also note that Coveralls is also used to analyze the coverage of your contribution.

The Versions

25/03 2018

dev-master

9999999-dev

AMQ handler for Cradle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Christian Blanquera

cradle cradlephp

25/03 2018

0.0.3

0.0.3.0

AMQ handler for Cradle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Christian Blanquera

cradle cradlephp

12/03 2018

0.0.2

0.0.2.0

AMQ handler for Cradle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Christian Blanquera

cradle cradlephp