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",")","."]
code: def __init__(self, event_collector: EventService):
      super().__init__()
  
      self.event_collector = event_collector
  
      self.interface_to_subscribers: Dict[
          Type[T], List[Subscriber]
      ] = dict()
      """map of interface class to the list of subscribed receivers"""
  
      self.subscribers: List[Subscriber] = list()
      """all registered subscribers"""
  
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 1 to create a new Pubsub object from inherited base classes: EventScope with example: obj = Pubsub(event_collector)