disconnect() public méthode

Closes the connection to Redis.
public disconnect ( )
 /**
  * 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);
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 protected function executePipeline(ConnectionInterface $connection, SplQueue $commands)
 {
     while (!$commands->isEmpty()) {
         $connection->writeRequest($commands->dequeue());
     }
     $connection->disconnect();
     return array();
 }
Exemple #3
0
 /**
  * Closes the underlying connection and disconnects from the server.
  */
 public function disconnect()
 {
     $this->connection->disconnect();
 }
Exemple #4
0
 /**
  * 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);
 }