Exemplo n.º 1
0
class Server(object):
    _sync = {}
    _async = ['add_actors', 'add', 'sync_add','print_references']
    _ref = ['add_actors']
    _parallel = []
    
    def add_actors(self, list_actors):
        self.amulti = AMulti(list_actors)
        self.smulti = SMulti(list_actors, self._atom)
    
    def add(self, x, y):
        self.amulti.add(x, y)
    
    def sync_add(self, x, y):
        result =  self.smulti.sync_add(x, y)
        print 'siiiiiiiiiiiiiiiiiiiiii', result
    def print_references(self):
        print self.smulti.get_reference()
Exemplo n.º 2
0
class Server(object):
    _sync = {'add_actors':'20'}
    _async = ['add', 'sync_add','print_references']
    _ref = ['add_actors']
    _parallel = []

    def add_actors(self, list_actors):
        self.supervisor = Supervisor(5, 3, self._atom, list_actors)
        self.amulti = AMulti(list_actors)
        self.smulti = SMulti(self._atom, list_actors)
        return True
    def add(self, x, y):
        self.amulti.add(x, y)

    def sync_add(self, x, y):
        result =  self.smulti.sync_add(x, y)
        print result.values()
    def print_references(self):
        print self.smulti.get_reference().values()
    def failure_detect(self, from_actor):
        print 'failure', from_actor
Exemplo n.º 3
0
class Server(object):
    _sync = {}
    _async = ['add_actors', 'add', 'sync_add','print_references']
    _ref = ['add_actors']
    _parallel = []
    
    def add_actors(self, list_actors):
        print list_actors
        self.amulti = AMulti(list_actors)
        self.smulti = SMulti(self._atom, list_actors)
        self.list_actors = list_actors
    def add(self, x, y):
        self.amulti.add(x, y)
    
    def sync_add(self, x, y):
        result =  self.smulti.sync_add(x, y)
        print result.values()
    def print_references(self):
        for a in range(16):
            print 'hola'
            print self.smulti.get_reference().keys()