Subscription Handler. To receive events from server for a subscription data_change and event methods are called directly from receiving thread. Do not do expensive, slow or network operation there. Create another thread if you need to do such a thing
| 20 | |
| 21 | |
| 22 | class SubHandler(object): |
| 23 | |
| 24 | """ |
| 25 | Subscription Handler. To receive events from server for a subscription |
| 26 | data_change and event methods are called directly from receiving thread. |
| 27 | Do not do expensive, slow or network operation there. Create another |
| 28 | thread if you need to do such a thing |
| 29 | """ |
| 30 | |
| 31 | def datachange_notification(self, node, val, data): |
| 32 | print("Python: New data change event", node, val) |
| 33 | |
| 34 | def event_notification(self, event): |
| 35 | print("Python: New event", event) |
| 36 | |
| 37 | |
| 38 | if __name__ == "__main__": |