示例#1
0
 /**
  * @param mixed $message
  * @param int   $flags
  * @param array $attributes
  *
  * @return bool
  */
 public function publish($message, $flags = Client::NOPARAM, array $attributes = [])
 {
     $attributes = ArrayHelper::merge(['app_id' => \Yii::$app ? \Yii::$app->name : ''], $attributes);
     return $this->exchange->publish($message, $this->routingKey, $flags, $attributes);
 }
示例#2
0
 /**
  * @param Exchange|string $exchange
  *
  * @return string
  */
 public static function getExchangeName($exchange)
 {
     return !$exchange instanceof Exchange ? $exchange : $exchange->getName();
 }