Example #1
0
 /**
  * Closes channel.
  *
  * @param int $replyCode
  * @param string $replyText
  * @return Protocol\MethodChannelCloseOkFrame|PromiseInterface
  */
 public function close($replyCode = 0, $replyText = "")
 {
     $ret = $this->client->closeChannel($this, $replyCode, $replyText);
     // break reference cycle, must be called AFTER Client::closeChannel(), because in Client::closeChannel() channel's client is checked
     unset($this->client);
     $this->deliverCallbacks = [];
     // break consumers' reference cycle
     return $ret;
 }