class_docstr: A handle used to make requests from one deployment to another.
  
  This is used to compose multiple deployments into a single application. After
  building the application, this handle is substituted at runtime for deployments
  passed as arguments via `.bind()`.
  
  Example:
  
  .. code-block:: python
  
      import ray
      from ray import serve
      from ray.serve.handle import RayServeHandle, RayServeSyncHandle
  
      @serve.deployment
      class Downstream:
          def __init__(self, message: str):
              self._message = message
  
          def __call__(self, name: str) -> str:
              return self._message + name
  
      @serve.deployment
      class Ingress:
          def __init__(self, handle: RayServeHandle):
              self._handle = handle
  
          async def __call__(self, name: str) -> str:
              obj_ref: ray.ObjectRef = await self._handle.remote(name)
              return await obj_ref
  
      app = Ingress.bind(Downstream.bind("Hello "))
      handle: RayServeSyncHandle = serve.run(app)
  
      # Prints "Hello Mr. Magoo"
      print(ray.get(handle.remote("Mr. Magoo")))
class_docstr_tok: ["A","handle","used","to","make","requests","from","one","deployment","to","another",".","This","is","used","to","compose","multiple","deployments","into","a","single","application",".","After","building","the","application",",","this","handle","is","substituted","at","runtime","for","deployments","passed","as","arguments","via","`",".bind","(",")","`",".","Example",":","..","code-block",":",":","python","import","ray","from","ray","import","serve","from","ray.serve.handle","import","RayServeHandle",",","RayServeSyncHandle","@","serve.deployment","class","Downstream",":","def","__init__","(","self",",","message",":","str",")",":","self._message","=","message","def","__call__","(","self",",","name",":","str",")","-",">","str",":","return","self._message","+","name","@","serve.deployment","class","Ingress",":","def","__init__","(","self",",","handle",":","RayServeHandle",")",":","self._handle","=","handle","async","def","__call__","(","self",",","name",":","str",")","-",">","str",":","obj_ref",":","ray.ObjectRef","=","await","self._handle.remote","(","name",")","return","await","obj_ref","app","=","Ingress.bind","(","Downstream.bind","(","``","Hello","``",")",")","handle",":","RayServeSyncHandle","=","serve.run","(","app",")","#","Prints","``","Hello","Mr.","Magoo","''","print","(","ray.get","(","handle.remote","(","``","Mr.","Magoo","''",")",")",")"]
docstr: Issue an asynchronous request to the __call__ method of the deployment.
  
  Returns an `asyncio.Task` whose underlying result is a Ray ObjectRef that
  points to the final result of the request.
  
  The final result can be retrieved by awaiting the ObjectRef.
  
  Example:
  
  .. code-block:: python
  
      obj_ref = await handle.remote(*args)
      result = await obj_ref
docstr_tok: ["Issue","an","asynchronous","request","to","the","__call__","method","of","the","deployment",".","Returns","an","`","asyncio.Task","`","whose","underlying","result","is","a","Ray","ObjectRef","that","points","to","the","final","result","of","the","request",".","The","final","result","can","be","retrieved","by","awaiting","the","ObjectRef",".","Example",":","..","code-block",":",":","python","obj_ref","=","await","handle.remote","(","*","args",")","result","=","await","obj_ref"]
code: def remote(self, *args, **kwargs) -> asyncio.Task:
      """Issue an asynchronous request to the __call__ method of the deployment.
  
      Returns an `asyncio.Task` whose underlying result is a Ray ObjectRef that
      points to the final result of the request.
  
      The final result can be retrieved by awaiting the ObjectRef.
  
      Example:
  
      .. code-block:: python
  
          obj_ref = await handle.remote(*args)
          result = await obj_ref
  
      """
      future = self._remote(args, kwargs)
  
      async def await_future():
          return await asyncio.wrap_future(future)
  
      task = asyncio.ensure_future(await_future())
      # NOTE(edoakes): this is a hack to enable the legacy behavior of passing
      # `asyncio.Task` objects directly to downstream handle calls without `await`.
      # Because the router now runs on a separate loop, the `asyncio.Task` created
      # here can't directly be awaited by it. So we include a reference to the
      # underlying (thread-safe) `concurrent.futures.Future`.
      # This can be removed when `RayServeHandle` is fully deprecated.
      task._ray_serve_object_ref_future = future
      return task
  
imports: import asyncio
  import concurrent.futures
  import threading
  import warnings
  from dataclasses import dataclass
  from typing import Any, AsyncIterator, Dict, Iterator, Optional, Tuple, Union
  import ray
  from ray import serve
  from ray._raylet import GcsClient, ObjectRefGenerator
  from ray.serve._private.common import DeploymentID, RequestProtocol
  from ray.serve._private.default_impl import create_cluster_node_info_cache
  from ray.serve._private.router import RequestMetadata, Router
  from ray.serve._private.usage import ServeUsageTag
  from ray.serve._private.utils import DEFAULT, get_current_actor_id, get_random_string, is_running_in_asyncio_loop
  from ray.util import metrics
  from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
label_desc: Use image node_id 2 for calling the RayServeHandle obj's underlying member method code with example usage: obj.remote() and returns: task, unknown