class_docstr: Implementation of a message broker (Pubsub stands for publish and subscribe).
class_docstr_tok: ["Implementation","of","a","message","broker","(","Pubsub","stands","for","publish","and","subscribe",")","."]
docstr: Returns a proxy instance of the event interface, which the publisher can use to publish events. Behind the
  scenes every event invocation is serialized as EventRecord object and then routed to the registered
  subscribers.
  
  :param interface_class: The class object of an abstract interface that defines the events as methods.
  :return:    A proxy object, dynamically derived from the passed `interface_class`. This class is intended to
              be used by the publisher to trigger events.
docstr_tok: ["Returns","a","proxy","instance","of","the","event","interface",",","which","the","publisher","can","use","to","publish","events",".","Behind","the","scenes","every","event","invocation","is","serialized","as","EventRecord","object","and","then","routed","to","the","registered","subscribers",".",":","param","interface_class",":","The","class","object","of","an","abstract","interface","that","defines","the","events","as","methods",".",":","return",":","A","proxy","object",",","dynamically","derived","from","the","passed","`","interface_class","`",".","This","class","is","intended","to","be","used","by","the","publisher","to","trigger","events","."]
code: def create_event_topic(self, interface_class: Type[T]) -> T:
      """
      Returns a proxy instance of the event interface, which the publisher can use to publish events. Behind the
      scenes every event invocation is serialized as EventRecord object and then routed to the registered
      subscribers.
  
      :param interface_class: The class object of an abstract interface that defines the events as methods.
      :return:    A proxy object, dynamically derived from the passed `interface_class`. This class is intended to
                  be used by the publisher to trigger events.
      """
  
      recorder = self.event_collector.create_event_topic(
          interface_class, self
      )
  
      # init list of registered subscribers if not already present
      if interface_class not in self.interface_to_subscribers:
          self.interface_to_subscribers[interface_class] = []
  
      return recorder
  
file_path: maze/maze/core/events/pubsub.py
imports: import inspect
  from abc import ABC, abstractmethod
  from typing import Callable, List, Iterable, Dict, Union, Type, TypeVar
  from maze.core.events.event_collection import EventCollection
  from maze.core.events.event_service import EventScope, EventRecord, EventService
label_desc: Use image node_id 2 for calling the Pubsub obj's underlying member method code with example usage: obj.create_event_topic(interface_class) and returns: recorder