More advanced subscription client using Future, so we can wait for events in tests
| 14 | |
| 15 | |
| 16 | class MySubHandler(): |
| 17 | |
| 18 | ''' |
| 19 | More advanced subscription client using Future, so we can wait for events in tests |
| 20 | ''' |
| 21 | |
| 22 | def __init__(self): |
| 23 | self.future = Future() |
| 24 | |
| 25 | def reset(self): |
| 26 | self.future = Future() |
| 27 | |
| 28 | def datachange_notification(self, node, val, data): |
| 29 | self.future.set_result((node, val, data)) |
| 30 | |
| 31 | def event_notification(self, event): |
| 32 | self.future.set_result(event) |
| 33 | |
| 34 | |
| 35 | class MySubHandler2(object): |
no outgoing calls