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: Register a subscriber to receive events from certain published interfaces,
      specified by Subscriber.get_interfaces()
  
  :param new_subscriber: the subscriber to be registered
  :return: None
docstr_tok: ["Register","a","subscriber","to","receive","events","from","certain","published","interfaces",",","specified","by","Subscriber.get_interfaces","(",")",":","param","new_subscriber",":","the","subscriber","to","be","registered",":","return",":","None"]
code: def register_subscriber(self, new_subscriber: Subscriber):
      """Register a subscriber to receive events from certain published interfaces,
          specified by Subscriber.get_interfaces()
  
      :param new_subscriber: the subscriber to be registered
      :return: None
      """
      self.subscribers.append(new_subscriber)
  
      # add the new subscriber to all interfaces for which events should be received
      for interface_class in new_subscriber.get_interfaces():
          if interface_class not in self.interface_to_subscribers:
              self.interface_to_subscribers[interface_class] = []
  
          registered_subscribers = self.interface_to_subscribers[
              interface_class
          ]
          registered_subscribers.append(new_subscriber)
  
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 3 for calling the Pubsub obj's underlying member method code with example usage: obj.register_subscriber(new_subscriber) without return types