class_docstr: Event system that handles storing and calling callbacks for events.
  
  Attributes:
      callback_map (Dict[str, List[Callable]]) : Stores list of callbacks
          for events when registered.
docstr: Stores callback handler for event.
  
  Args:
      event: Event that callback should be called on. See
          CreateClusterEvent for details on the events available to be
          registered against.
      callback (Callable[[Dict], None]): Callable object that is invoked
          when specified event occurs.
docstr_tok: ["Stores","callback","handler","for","event",".","Args",":","event",":","Event","that","callback","should","be","called","on",".","See","CreateClusterEvent","for","details","on","the","events","available","to","be","registered","against",".","callback","(","Callable","[","[","Dict","]",",","None","]",")",":","Callable","object","that","is","invoked","when","specified","event","occurs","."]
code: def add_callback_handler(
      self,
      event: str,
      callback: Union[
          Callable[[Dict], None], List[Callable[[Dict], None]]
      ],
  ):
      """Stores callback handler for event.
  
      Args:
          event: Event that callback should be called on. See
              CreateClusterEvent for details on the events available to be
              registered against.
          callback (Callable[[Dict], None]): Callable object that is invoked
              when specified event occurs.
      """
      if event not in CreateClusterEvent.__members__.values():
          cli_logger.warning(
              f"{event} is not currently tracked, and this"
              " callback will not be invoked."
          )
  
      self.callback_map.setdefault(event, []).extend(
          [callback] if type(callback) is not list else callback
      )
  
file_path: ray/python/ray/autoscaler/_private/event_system.py
imports: from enum import Enum, auto
  from typing import Any, Callable, Dict, List, Optional, Union
  from ray.autoscaler._private.cli_logger import cli_logger
label_desc: Use image node_id 2 for calling the _EventSystem obj's underlying member method code with example usage: obj.add_callback_handler(event, callback) without return types