summaryrefslogtreecommitdiff
path: root/esds/simulator.py
diff options
context:
space:
mode:
Diffstat (limited to 'esds/simulator.py')
-rw-r--r--esds/simulator.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/esds/simulator.py b/esds/simulator.py
index 960d87f..f56dfcb 100644
--- a/esds/simulator.py
+++ b/esds/simulator.py
@@ -124,9 +124,6 @@ class Simulator:
sorted_indexes=np.lexsort((self.events[:,3],self.events[:,1]))
self.events=self.events[sorted_indexes]
- def notify_node_plugin(self,node,function,args):
- self.nodes[node]["plugin_notify"][function]=args
-
def sync_node_non_blocking(self,node, timeout_remove_only=False):
"""
Process all call request and wait for Node.sync() to return
@@ -362,7 +359,13 @@ class Simulator:
selector = self.netmat[interface]["bandwidth"][node.node_id,] > 0
return np.arange(0,selector.shape[0])[selector]
-
+ def notify_node_plugins(self,node,callback,args):
+ node[pending_plugin_notify]+=1
+ self.nodes[int(event[2][1])].rqueue.put(("plugin_notify",callback,args))
+ # Now ensure that all callbacks are called before continuing
+ while node[pending_plugin_notify] > 0:
+ pass
+
def add_event(self,event_type,event_ts,event,priority=2):
"""
Call this function with sort=True the least amount of time possible