class_docstr: Event manager for Ray futures.
  
  The event manager can be used to track futures and invoke callbacks when
  they resolve.
  
  Futures are tracked with :meth:`track_future`. Future can then be awaited with
  :meth:`wait`. When futures successfully resolve, they trigger an optional
  ``on_result`` callback that can be passed to :meth:`track_future`. If they
  fail, they trigger an optional ``on_error`` callback.
  
  Args:
      shuffle_futures: If True, futures will be shuffled before awaited. This
          will avoid implicit prioritization of futures within Ray.
docstr: Resolve a single future.
  
  This method will block until the future is available. It will then
  trigger the callback associated to the future and the event (success
  or error), if specified.
  
  Args:
      future: Ray future to resolve.
code: def resolve_future(self, future: ray.ObjectRef):
      """Resolve a single future.
  
      This method will block until the future is available. It will then
      trigger the callback associated to the future and the event (success
      or error), if specified.
  
      Args:
          future: Ray future to resolve.
  
      """
      try:
          on_result, on_error = self._tracked_futures.pop(future)
      except KeyError as e:
          raise ValueError(
              f"Future {future} is not tracked by this RayEventManager"
          ) from e
  
      try:
          result = ray.get(future)
      except Exception as e:
          if on_error:
              on_error(e)
          else:
              raise e
      else:
          if on_result:
              on_result(result)
  
file_path: ray/python/ray/air/execution/_internal/event_manager.py
imports: import random
  import ray
  from typing import Any, Callable, Dict, Iterable, Optional, Set, Tuple, Union
label_desc: Use image node_id 7 for calling the RayEventManager obj's underlying member method code with example usage: obj.resolve_future(future) without return types