Cloud, SaaS, Python, Python Programming, Web Development.
dict() def subscribe(self, event_type, handler): if event_type not in self.subscribers: self.subscribers[event_type] = [] self.subscribers[event_type].append(handler) def post(self, event_type, data): if event_type in self.subscribers: for handler in self.subscribers[event_type]: handler(data)