mirror of
https://github.com/elyby/accounts.git
synced 2024-12-05 04:58:56 +05:30
20 lines
410 B
PHP
20 lines
410 B
PHP
|
<?php
|
||
|
namespace common\components\RabbitMQ;
|
||
|
|
||
|
use Yii;
|
||
|
|
||
|
class Helper {
|
||
|
|
||
|
/**
|
||
|
* @return Component $amqp
|
||
|
*/
|
||
|
public static function getInstance() {
|
||
|
return Yii::$app->get('amqp');
|
||
|
}
|
||
|
|
||
|
public static function sendToExchange($exchange, $routingKey, $message, $exchangeArgs = []) {
|
||
|
static::getInstance()->sendToExchange($exchange, $routingKey, $message, $exchangeArgs);
|
||
|
}
|
||
|
|
||
|
}
|