code: def init_app(self, app: Flask) -> None:
      config = app.config
      if (
          config["CACHE_CONFIG"]["CACHE_TYPE"] == "null"
          or config["DATA_CACHE_CONFIG"]["CACHE_TYPE"] == "null"
      ):
          raise Exception(  # pylint: disable=broad-exception-raised
              """
                  Cache backends (CACHE_CONFIG, DATA_CACHE_CONFIG) must be configured
                  and non-null in order to enable async queries
                  """
          )
  
      if len(config["GLOBAL_ASYNC_QUERIES_JWT_SECRET"]) < 32:
          raise AsyncQueryTokenException(
              "Please provide a JWT secret at least 32 bytes long"
          )
  
      self._redis = redis.Redis(
          **config["GLOBAL_ASYNC_QUERIES_REDIS_CONFIG"],
          decode_responses=True,
      )
      self._stream_prefix = config[
          "GLOBAL_ASYNC_QUERIES_REDIS_STREAM_PREFIX"
      ]
      self._stream_limit = config[
          "GLOBAL_ASYNC_QUERIES_REDIS_STREAM_LIMIT"
      ]
      self._stream_limit_firehose = config[
          "GLOBAL_ASYNC_QUERIES_REDIS_STREAM_LIMIT_FIREHOSE"
      ]
      self._jwt_cookie_name = config[
          "GLOBAL_ASYNC_QUERIES_JWT_COOKIE_NAME"
      ]
      self._jwt_cookie_secure = config[
          "GLOBAL_ASYNC_QUERIES_JWT_COOKIE_SECURE"
      ]
      self._jwt_cookie_samesite = config[
          "GLOBAL_ASYNC_QUERIES_JWT_COOKIE_SAMESITE"
      ]
      self._jwt_cookie_domain = config[
          "GLOBAL_ASYNC_QUERIES_JWT_COOKIE_DOMAIN"
      ]
      self._jwt_secret = config["GLOBAL_ASYNC_QUERIES_JWT_SECRET"]
  
      if config["GLOBAL_ASYNC_QUERIES_REGISTER_REQUEST_HANDLERS"]:
          self.register_request_handlers(app)
  
      # pylint: disable=import-outside-toplevel
      from superset.tasks.async_queries import (
          load_chart_data_into_cache,
          load_explore_json_into_cache,
      )
  
      self._load_chart_data_into_cache_job = load_chart_data_into_cache
      self._load_explore_json_into_cache_job = (
          load_explore_json_into_cache
      )
  
imports: import json
  import logging
  import uuid
  from typing import Any, Literal, Optional
  import jwt
  import redis
  from flask import Flask, request, Request, Response, session
  from superset.utils.core import get_user_id
label_desc: Use image node_id 2 for calling the AsyncQueryManager obj's underlying member method code with example usage: obj.init_app(app) without return types