From ebb7d4799f00c6ebb2cb1f53dcce4e1b1cc884f3 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Sun, 14 Jun 2015 23:48:29 +0200 Subject: Fix notifications responses colliding with request response.. --- resource_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resource_manager.py b/resource_manager.py index 8aa4fb8..8dcf6bc 100644 --- a/resource_manager.py +++ b/resource_manager.py @@ -54,12 +54,15 @@ class ResourceManagerBase(object): def get_answer(self): data = self.receive_message() + notifications = [] while not data.answer: if data.notify: - self.handle_notification(data.notify) + notifications.append(data.notify) else: raise AssertionError('Unknown response') data = self.receive_message() + for notification in notifications: + self.handle_notification(notification) return data.answer def handle_notification(self, notification): -- cgit v1.2.1