More advanced subscription client using Future, so we can wait for events in tests
| 30 | |
| 31 | |
| 32 | class MySubHandler(): |
| 33 | |
| 34 | """ |
| 35 | More advanced subscription client using Future, so we can wait for events in tests |
| 36 | """ |
| 37 | |
| 38 | def __init__(self): |
| 39 | self.future = Future() |
| 40 | |
| 41 | def reset(self): |
| 42 | self.future = Future() |
| 43 | |
| 44 | def datachange_notification(self, node, val, data): |
| 45 | self.future.set_result((node, val, data)) |
| 46 | |
| 47 | def event_notification(self, event): |
| 48 | self.future.set_result(event) |
| 49 | |
| 50 | |
| 51 | class MySubHandler2(): |
no outgoing calls