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.
code: def __init__(self, shuffle_futures: bool = True):
      self._shuffle_futures = shuffle_futures
  
      # Map of futures to callbacks (result, error)
      self._tracked_futures: Dict[
          ray.ObjectRef,
          Tuple[Optional[_ResultCallback], Optional[_ErrorCallback]],
      ] = {}
  
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 1 to create a new RayEventManager object  with example: obj = RayEventManager(shuffle_futures)