class_docstr: A client class
  
  Provide the connection tool functions for ClientProvider.
docstr: Send a certain request to server.
  
  Parameters
  ----------
  request_type : str
      type of proposed request, 'calendar'/'instrument'/'feature'.
  request_content : dict
      records the information of the request.
  msg_proc_func : func
      the function to process the message when receiving response, should have arg `*args`.
  msg_queue: Queue
      The queue to pass the message after callback.
code: def send_request(
      self, request_type, request_content, msg_queue, msg_proc_func=None
  ):
      """Send a certain request to server.
  
      Parameters
      ----------
      request_type : str
          type of proposed request, 'calendar'/'instrument'/'feature'.
      request_content : dict
          records the information of the request.
      msg_proc_func : func
          the function to process the message when receiving response, should have arg `*args`.
      msg_queue: Queue
          The queue to pass the message after callback.
      """
      head_info = {"version": qlib.__version__}
  
      def request_callback(*args):
          """callback_wrapper
  
          :param *args: args[0] is the response content
          """
          # args[0] is the response content
          self.logger.debug("receive data and enter queue")
          msg = dict(args[0])
          if msg["detailed_info"] is not None:
              if msg["status"] != 0:
                  self.logger.error(msg["detailed_info"])
              else:
                  self.logger.info(msg["detailed_info"])
          if msg["status"] != 0:
              ex = ValueError(
                  f"Bad response(status=={msg['status']}), detailed info: {msg['detailed_info']}"
              )
              msg_queue.put(ex)
          else:
              if msg_proc_func is not None:
                  try:
                      ret = msg_proc_func(msg["result"])
                  except Exception as e:
                      self.logger.exception(
                          "Error when processing message."
                      )
                      ret = e
              else:
                  ret = msg["result"]
              msg_queue.put(ret)
          self.disconnect()
          self.logger.debug("disconnected")
  
      self.logger.debug("try connecting")
      self.connect_server()
      self.logger.debug("connected")
      # The pickle is for passing some parameters with special type(such as
      # pd.Timestamp)
      request_content = {
          "head": head_info,
          "body": pickle.dumps(
              request_content, protocol=C.dump_protocol_version
          ),
      }
      self.sio.on(request_type + "_response", request_callback)
      self.logger.debug("try sending")
      self.sio.emit(request_type + "_request", request_content)
      self.sio.wait()
  
file_path: qlib/qlib/data/client.py
imports: from __future__ import division
  from __future__ import print_function
  import socketio
  import qlib
  from ..config import C
  from ..log import get_module_logger
  import pickle
label_desc: Use image node_id 4 for calling the Client obj's underlying member method code with example usage: obj.send_request(request_type, request_content, msg_queue, msg_proc_func) without return types