public disconnect ( ) : boolean | ||
return | boolean | true if connection was successfully closed, false otherwise. |
public function disconnect()
{
}
/** * @param array $event * @return bool */ public function publish($event = []) { try { if (!$this->connection->isConnected()) { $this->connection->connect(); } list($message, $attributes) = $this->prepareMessage($event); $result = $this->getExchange()->publish($message, null, AMQP_NOPARAM, $attributes); $this->connection->disconnect(); return $result; } catch (\Exception $e) { return false; } }