2017 © Pedro Peláez
 

yii2-extension yii2-queue

Helper classes for working with google products and technologies

image

strong2much/yii2-queue

Helper classes for working with google products and technologies

  • Monday, August 29, 2016
  • by strong2much
  • Repository
  • 1 Watchers
  • 0 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

yii2-queue

This extension is using for works with different message queue services., (*1)

Installation

Install package by composer, (*2)

{
    "require": {
       "strong2much/yii2-queue": "dev-master"
    }
}

Or

$ composer require strong2much/yii2-queue "dev-master"

Use the following code in your configuration file. You can use different services, (*3)

'queue' => [
    'class' => 'strong2much\queue\QueueManager'
    'serviceConfig' => [
        'class' => 'strong2much\queue\services\DummyQueue',
    ]
]

Then you can send messages like so:, (*4)

$msg = new \strong2much\queue\messages\TestMessage();
$msg->id = 1;
$msg->message = "Some text";
if($msg->send()) {
    echo "OK";
}

Then you can use manager to handle your messages, (*5)

//To receive messages
$route = 'mq_test'; //just for example
$message = Yii::$app->queue->receiveMessage($route); //this will get first  one message from the queue

//if you specify some processing function in message model,
//then you can call it like so
if($message !== false) {
    Yii::app()->queue->processData($route, \yii\base\helpers\Json::decode($message));
}

In order to use DbQueue as your service, you will need to apply the provided migrations., (*6)

The Versions

29/08 2016

dev-master

9999999-dev https://github.com/strong2much/yii2-queue.git

Helper classes for working with google products and technologies

  Sources   Download

BSD-3-Clause

The Requires

 

rabbitmq yii2 queue amazonsqs