cblanquera / cradle-queue
AMQ handler for Cradle
Installs: 4 873
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
Type:plugin
Requires
- php: >=5.6.0
- cradlephp/packages: dev-master
- php-amqplib/php-amqplib: ^2.6
Requires (Dev)
- phpunit/phpunit: ~5.4
- satooshi/php-coveralls: ^1.0
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2022-02-01 13:00:42 UTC
README
Deprecation Notice: This project has been moved to https://github.com/CradlePHP/cradle-queue
cradle-queue
RabbitMQ with Fork and Exec workers. Built for the Cradle Framework
1. Requirements
You should be using CradlePHP currently at dev-master
. See
https://cradlephp.github.io/ for more information.
2. Install
composer require cblanquera/cradle-queue
Then in /bootstrap.php
, add
->register('cblanquera/cradle-queue')
3. Setup
Open /config/services.php
and add
'rabbitmq-main' => [
'host' => '127.0.0.1',
'port' => 5672,
'user' => 'guest',
'pass' => 'guest'
],
4. Methods
cradle('global')->queue(*string $event, array $data);
An easy way to queue.
cradle('global')
->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).