class_docstr: Defining a custom event listener. Event listeners provide an efficient way
  to listen for a custom event.
  
  Event listeners should be stateless. They will be instantiated from a
  coordinator actor.
  
  Example definition
  ==================
  
  ```
  class CustomEventListener:
  
      def __init__(self):
          self.event_provider = ...
  
      async def poll_for_event(self, topic, partition):
          return await self.event_provider.poll(topic, partition)
  
      async def event_checkpointed(self, event: Event):
          self.event_provider.commit(event.offset)
  ```
  
  Example Usage
  =============
  .. testcode::
      :skipif: True
  
      from ray import workflow
      CustomEventListener = ...
      event_task = workflow.wait_for_event(
          CustomEventListener, "topic1", "partition2")
      handle_event = ...
      workflow.run(handle_event.task(event_task))
docstr: Optional constructor. Only the constructor with now arguments will be
  called.
docstr_tok: ["Optional","constructor",".","Only","the","constructor","with","now","arguments","will","be","called","."]
code: def __init__(self):
      """Optional constructor. Only the constructor with now arguments will be
      called."""
      pass
  
file_path: ray/python/ray/workflow/event_listener.py
imports: import asyncio
  from ray.util.annotations import PublicAPI
  from ray.workflow.common import Event
  import time
  from typing import Callable
label_desc: Use image node_id 1 to create a new EventListener object  with example: obj = EventListener()