class_docstr: Object to encapsulate the code related to handle the data requests passing to executor and its returned values
class_docstr_tok: ["Object","to","encapsulate","the","code","related","to","handle","the","data","requests","passing","to","executor","and","its","returned","values"]
code: def _http_fastapi_default_app(self, **kwargs):
      from jina.serve.runtimes.worker.http_fastapi_app import (  # For Gateway, it works as for head
          get_fastapi_app,
      )
  
      request_models_map = self._executor._get_endpoint_models_dict()
  
      def call_handle(request):
          is_generator = request_models_map[
              request.header.exec_endpoint
          ]["is_generator"]
  
          return self.process_single_data(
              request, None, is_generator=is_generator
          )
  
      app = get_fastapi_app(
          request_models_map=request_models_map,
          caller=call_handle,
          **kwargs,
      )
  
      @app.on_event("shutdown")
      async def _shutdown():
          await self.close()
  
      from jina.helper import extend_rest_interface
  
      return extend_rest_interface(app)
  
imports: import argparse
  import asyncio
  import functools
  import json
  import os
  import tempfile
  import threading
  import uuid
  import warnings
  from typing import TYPE_CHECKING, AsyncIterator, Dict, Generator, List, Optional, Tuple, Union
  from google.protobuf.struct_pb2 import Struct
  from jina._docarray import DocumentArray, docarray_v2
  from jina.constants import __default_endpoint__
  from jina.excepts import BadConfigSource, RuntimeTerminated
  from jina.helper import get_full_version
  from jina.importer import ImportExtensions
  from jina.proto import jina_pb2
  from jina.serve.executors import BaseExecutor
  from jina.serve.instrumentation import MetricsTimer
  from jina.serve.runtimes.worker.batch_queue import BatchQueue
  from jina.types.request.data import DataRequest, SingleDocumentRequest
label_desc: Use image node_id 2 for calling the WorkerRequestHandler obj's underlying member method code with example usage: obj._http_fastapi_default_app() and returns: extend_rest_interface, self