class_docstr: Parser class for connections using Hiredis
class_docstr_tok: ["Parser","class","for","connections","using","Hiredis"]
code: def on_connect(self, connection, **kwargs):
      import hiredis
  
      self._sock = connection._sock
      self._socket_timeout = connection.socket_timeout
      kwargs = {
          "protocolError": InvalidResponse,
          "replyError": self.parse_error,
          "errors": connection.encoder.encoding_errors,
      }
  
      if connection.encoder.decode_responses:
          kwargs["encoding"] = connection.encoder.encoding
      self._reader = hiredis.Reader(**kwargs)
      self._next_response = False
  
imports: import asyncio
  import socket
  import sys
  from typing import Callable, List, Optional, TypedDict, Union
  from ..exceptions import ConnectionError, InvalidResponse, RedisError
  from ..typing import EncodableT
  from ..utils import HIREDIS_AVAILABLE
  from .base import AsyncBaseParser, BaseParser
  from .socket import NONBLOCKING_EXCEPTION_ERROR_NUMBERS, NONBLOCKING_EXCEPTIONS, SENTINEL, SERVER_CLOSED_CONNECTION_ERROR
label_desc: Use image node_id 3 for calling the _HiredisParser obj's underlying member method code with example usage: obj.on_connect(connection) without return types