class_docstr: Async implementation of parser class for connections using Hiredis
class_docstr_tok: ["Async","implementation","of","parser","class","for","connections","using","Hiredis"]
code: def on_connect(self, connection):
      import hiredis
  
      self._stream = connection._reader
      kwargs: _HiredisReaderArgs = {
          "protocolError": InvalidResponse,
          "replyError": self.parse_error,
      }
      if connection.encoder.decode_responses:
          kwargs["encoding"] = connection.encoder.encoding
          kwargs["errors"] = connection.encoder.encoding_errors
  
      self._reader = hiredis.Reader(**kwargs)
      self._connected = True
  
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 2 for calling the _AsyncHiredisParser obj's underlying member method code with example usage: obj.on_connect(connection) without return types