dev-master
9999999-dev https://github.com/strong2much/yii2-queue.gitHelper classes for working with google products and technologies
BSD-3-Clause
The Requires
rabbitmq yii2 queue amazonsqs
Helper classes for working with google products and technologies
This extension is using for works with different message queue services., (*1)
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)
Helper classes for working with google products and technologies
BSD-3-Clause
rabbitmq yii2 queue amazonsqs