def dispatch(self, event=None, msg=None):
        for listener, events in self.listeners.items():
            if events is None or event is None or event in events:
                try:
                    listener(self, event, msg)
                except (Exception,):
                    self.unregister(listener)
                    errmsg = "Exception in message dispatch: Handler '{0}' " \
                             "unregistered for event " \
                             "'{1}'  ".format(listener.func_name, event)
                    self.logger.exception(errmsg)
notify listeners
dataset/ETHPy150Open CarterBain/Medici/ib/client/sync_wrapper.py/Observable.dispatch