/** * Close the channel and connections to AMQP * * @return void */ public function closeConnections() { if ($this->channel) { $this->channel->close(); } if ($this->connection) { $this->connection->close(); } }
public function __destruct() { $this->channel->close(); unset($this->channel); $this->connection->close(); unset($this->connection); unset($this->replyQueueName); unset($this->consumerTag); unset($this->outputMessages); }
public function tearDown() { if ($this->channel) { $this->channel->queue_delete($this->queueName . '1'); $this->channel->close(); } if ($this->connection) { $this->connection->close(); } }
public function close() { if ($this->closed != true) { if ($this->channel != null) { $this->channel->close(); $this->channel = null; } if ($this->connection != null) { $this->connection->close(); $this->connection = null; } $this->closed = true; } }
/** * destructor */ public function __destruct() { if($this->socket){ echo "Closing socket..."; socket_close($this->socket); echo "OK.\n\n"; } if($this->amqChannel){ echo "Closing AMQ Channel..."; $this->amqChannel->close(); echo "OK.\n\n"; } if($this->amqConn){ echo "Closing AMQ Connection..."; $this->amqConn->close(); echo "OK.\n\n"; } }
/** * Closed AMQP connection */ public function closeConnection() { $this->channel->close(); $this->connection->close(); }