mirror of
https://github.com/elyby/accounts.git
synced 2024-11-27 01:02:06 +05:30
Используем вызов методов AMQP либы через ... оператор
This commit is contained in:
parent
999f8237e4
commit
e6fa0fe6f3
@ -111,8 +111,8 @@ class Component extends \yii\base\Component {
|
|||||||
public function sendToExchange($exchangeName, $routingKey, $message, $exchangeArgs = [], $publishArgs = []) {
|
public function sendToExchange($exchangeName, $routingKey, $message, $exchangeArgs = [], $publishArgs = []) {
|
||||||
$message = $this->prepareMessage($message);
|
$message = $this->prepareMessage($message);
|
||||||
$channel = $this->getChannel();
|
$channel = $this->getChannel();
|
||||||
call_user_func_array([$channel, 'exchange_declare'], $this->prepareExchangeArgs($exchangeName, $exchangeArgs));
|
$channel->exchange_declare(...$this->prepareExchangeArgs($exchangeName, $exchangeArgs));
|
||||||
call_user_func_array([$channel, 'basic_publish'], $this->preparePublishArgs($message, $exchangeName, $routingKey, $publishArgs));
|
$channel->basic_publish(...$this->preparePublishArgs($message, $exchangeName, $routingKey, $publishArgs));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user