disconnect() public method

Closes the connection to Redis.
public disconnect ( )
コード例 #1
0
 /**
  * Handles -ERR responses returned by Redis.
  *
  * @param ConnectionInterface $connection The connection that returned the error.
  * @param ResponseErrorInterface $response The error response instance.
  */
 protected function onResponseError(ConnectionInterface $connection, ResponseErrorInterface $response)
 {
     // Force disconnection to prevent protocol desynchronization.
     $connection->disconnect();
     $message = $response->getMessage();
     throw new ServerException($message);
 }
コード例 #2
0
ファイル: FireAndForget.php プロジェクト: huycao/yodelivery
 /**
  * {@inheritdoc}
  */
 protected function executePipeline(ConnectionInterface $connection, SplQueue $commands)
 {
     while (!$commands->isEmpty()) {
         $connection->writeRequest($commands->dequeue());
     }
     $connection->disconnect();
     return array();
 }
コード例 #3
0
ファイル: Client.php プロジェクト: nrk/predis
 /**
  * Closes the underlying connection and disconnects from the server.
  */
 public function disconnect()
 {
     $this->connection->disconnect();
 }
コード例 #4
0
ファイル: Pipeline.php プロジェクト: flachesis/predis
 /**
  * Throws an exception on -ERR responses returned by Redis.
  *
  * @param ConnectionInterface    $connection Redis connection that returned the error.
  * @param ErrorResponseInterface $response   Instance of the error response.
  *
  * @throws ServerException
  */
 protected function exception(ConnectionInterface $connection, ErrorResponseInterface $response)
 {
     $connection->disconnect();
     $message = $response->getMessage();
     throw new ServerException($message);
 }