Skip to content
Browse files

Started using groups.

  • Loading branch information...
1 parent dee11d6 commit cd46b3258b03f0641dbfd4713b6ea3e62481dccc @rik0 committed Sep 11, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 pynetsym/node_manager.py
View
5 pynetsym/node_manager.py
@@ -1,4 +1,5 @@
import sys
+from gevent.pool import Group
from traits.has_traits import Interface, implements
from traits.trait_types import List, Dict, Str
@@ -61,6 +62,7 @@ def __init__(self, id_manager, graph):
self.graph = graph
self.id_manager = id_manager
self.failures = []
+ self.group = Group()
def create_node(self, cls, parameters):
"""
@@ -78,10 +80,11 @@ def create_node(self, cls, parameters):
node = cls(self.graph, **parameters)
identifier = self.id_manager.get_identifier()
node.start(self._address_book, self._node_db, identifier)
+ self.group.add(node._greenlet)
return identifier
def simulation_ended(self):
- pass
+ self.group.join()
class IConfigurator(Interface):

0 comments on commit cd46b32

Please sign in to comment.
Something went wrong with that request. Please try again.