diff options
Diffstat (limited to 'esds/node.py')
| -rw-r--r-- | esds/node.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/esds/node.py b/esds/node.py index 6a2566d..59b6f96 100644 --- a/esds/node.py +++ b/esds/node.py @@ -13,7 +13,7 @@ class Node: self.rargs=None # Store the requests arguments self.plugins=list() # Contains all registered node plugins self.rqueue=queue.Queue() # Receive simulator acknowledgments - self.chest={"state":"running", "turned_on":True, "request": None, "interfaces":dict(), "interfaces_queue_size":dict()} + self.chest={"state":"running", "turned_on":True, "request": None, "interfaces":dict(), "interfaces_queue_size":dict(), "plugin_notify": dict()} for interface in interfaces: self.chest["interfaces"][interface]=queue.Queue() self.chest["interfaces_queue_size"][interface]=0 @@ -22,6 +22,11 @@ class Node: def plugin_register(self,plugin): self.plugins.append(plugin) + def plugin_handle_requests(self): + # Take plugins notification into account + for key in list(self["plugin_notify"]): + self.plugin_notify(key,self["plugin_notify"].pop(key)) + def plugin_notify(self,reason,args): """ This function strives to avoid using Python specific features @@ -33,6 +38,8 @@ class Node: p.on_send_call(args[0],args[1],args[2],args[3]) if reason == "send_return": p.on_send_return(args[0],args[1],args[2],args[3],args[4]) + if reason == "on_communication_end": + p.on_communication_end(args[0],args[1],args[2],args[3],args[4]) if reason == "terminated": p.on_terminated() |
