2017 © Pedro Peláez
 

yii2-extension yii2-queue

Extension for work with queues

image

yiisolutions/yii2-queue

Extension for work with queues

  • Sunday, April 30, 2017
  • by memclutter
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 8 % Grown

The README.md

Yii2 Queue

Extension for work with queues., (*1)

Installation

Use composer, (*2)

composer require "yiisolutions/yii2-migrations-advanced: *"

or add to composer.json require section:, (*3)

"yiisolutions/yii2-migrations-advanced": "*"

Configuration

First, we add to the configuration component., (*4)

<?php

return [
    // ...
    'components' => [
        // ...
        'queue' => [
            'class' => 'yisolutions\queue\Queue',
            'host' => 'localhost',
            'port' => 5672,
            'user' => 'guest',
            'password' => 'guest',
            'vhost' => '/',
        ],
        // ...
    ],
    // ...
];

Send data

Next, to send data to the queue, we use the send() component method., (*5)

<?php

use yiisolutions\queue\Queue;

// ...
$data = ['foo' => 'bar'];

/** @var Queue $queue */
$queue = Yii::$app->get('queue');
$queue->send('queue.name', $data);

Receive data

We use the listen method to retrieve data., (*6)

<?php

use yiisolutions\queue\Queue;
use PhpAmqpLib\Message\AMQPMessage;

// ...
/** @var Queue $queue */
$queue = Yii::$app->get('queue');
$queue->listen('queue.name', function(AMQPMessage $msg) use ($queue) {
    // process data

    // acknowledgment message
    $queue->acknowledgmentMessage($msg);
});

The Versions

30/04 2017

dev-master

9999999-dev

Extension for work with queues

  Sources   Download

BSD-3-Clause

The Requires

 

by Memory Clutter

rabbitmq yii2 queue amqp

30/04 2017

0.0.2

0.0.2.0

Extension for work with queues

  Sources   Download

BSD-3-Clause

The Requires

 

by Memory Clutter

rabbitmq yii2 queue amqp

30/04 2017

0.0.3

0.0.3.0

Extension for work with queues

  Sources   Download

BSD-3-Clause

The Requires

 

by Memory Clutter

rabbitmq yii2 queue amqp

27/04 2017

0.0.1

0.0.1.0

Extension for work with queues

  Sources   Download

BSD-3-Clause

The Requires

 

by Memory Clutter

rabbitmq yii2 queue amqp