コード例 #1
0
ファイル: __init__.py プロジェクト: raqueleyeos/pyactive
 def __call__(self, *args, **kwargs):
     new_args = get_host()._dumps(list(args))
     result = self.__send(self.__name, new_args, kwargs)
     if result != None:
         return get_host()._loads(result)
     else:
         return result
コード例 #2
0
ファイル: __init__.py プロジェクト: cloudspaces/pyactive
    def __call__(self, *args, **kwargs):
        new_args = get_host()._dumps(list(args))
        result = self.__send(self.__name, new_args, kwargs)
        if result != None:
            return {k: get_host()._loads(v) for k, v in result.items()}
#             return get_host()._loads(result.values)
        else:
            return result
コード例 #3
0
def launch(func, params=[]):
    t1 = Thread(target=func, args=params)
    threads[t1] = 'atom://localhost/'+func.__module__+'/'+func.__name__
    t1.start()
    t1.join()
    host =  controller.get_host()
    host._shutdown()
コード例 #4
0
ファイル: pyactive_thread.py プロジェクト: sfcelma/pyactive
def launch(func, params=[]):
    # TODO Mirar que funcione bien el tema de matar todos los threads
    t1 = Thread(target=func, args=params)
    threads[t1] = "atom://localhost/" + func.__module__ + "/" + func.__name__
    t1.start()
    t1.join()
    host = controller.get_host()
    host._shutdown()
コード例 #5
0
ファイル: pyactive_thread.py プロジェクト: sergitoda/pyactive
def launch(func, params=[]):
    #TODO Mirar que funcione bien el tema de matar todos los threads
    t1 = Thread(target=func, args=params)
    threads[t1] = 'atom://localhost/' + func.__module__ + '/' + func.__name__
    t1.start()
    t1.join()
    host = controller.get_host()
    host._shutdown()
コード例 #6
0
ファイル: __init__.py プロジェクト: cloudspaces/pyactive
 def attach(self, actor):
     dumps_actor = get_host()._dumps(actor)
     actor = get_host()._loads(dumps_actor)
     self.dict_actors[actor.get_aref()] = actor
コード例 #7
0
def signal_handler(signal, frame):
    print 'You pressed Ctrl+C!'
    host =  controller.get_host()
    host.shutdown()
    sys.exit(0)