(self, message)
| 66 | # ------------------- |
| 67 | |
| 68 | def notify_subscribers(self, message): |
| 69 | for subscriber in list(self.subscribers): # copy to avoid mutation during iteration |
| 70 | try: |
| 71 | subscriber.put_nowait(message) |
| 72 | except Exception: |
| 73 | pass # subscriber queue full or closed |
| 74 | |
| 75 | def subscribe(self): |
| 76 | q = Queue() |