def main(argv): global NUM_NODES, NUM_MSGS NUM_NODES = int(argv[0]) NUM_MSGS = int(argv[1]) start_controller('pyactive_thread') launch(testN) print 'finish!'
def test_load_oneway(self): launch(test1, [self]) launch(testN, [self])
def main(): start_controller('pyactive_thread') launch(client_test)
def main(): start_controller('tasklet') launch(test3)
def main(): start_controller('tasklet') launch(test_2pc) print 'now testing bad...'
def main(): start_controller('tasklet') launch(test3)
def test_hello(self): launch(test_hello, [self])
def test_registry_object(self): launch(test_registry_object, [self])
def main(): start_controller('pyactive_thread') launch(test_remote_spawn)
def main(): start_controller("tasklet") launch(test_remote_spawn)
def main(): start_controller('tasklet') launch(client_test)
def main(): start_controller('pyactive_thread') launch(testN) print 'finish!'
def test_registry_object(self): launch(test_registry_object, [self])
def main(): start_controller('pyactive_thread') launch(test_2pc) print 'now testing bad...' launch(test_2pc_bad)
def test_load_oneway_N(self): launch(testN,[self])
def test_load_oneway(self): launch(test1,[self])
_async = ['launch','remote_server'] _parallel = [] _ref = ["remote_server"] def launch(self): for i in range(5): print self.server.get_file(i) def remote_server(self, web_server): self.server = web_server def test(): host = init_host() # parameters 1 = 'id', 'test_sync' = module name, 'Server' = class name web = host.spawn_id('1', 'actor10', 'Web', []) load = host.spawn_id('1', 'actor10', 'Workload', []) load.remote_server(web) load.launch() if __name__ == '__main__': #you can change the parameter 'tasklet' to 'pyactive_thread' if you like thread controller. start_controller('pyactive_thread') launch(test)
def main(): start_controller('pyactive_thread') launch(test_log)
def main(): start_controller('pyactive_thread') launch(test3)
def main(): start_controller('tasklet') launch(client_test)
def test_throw_timeout(self): launch(test_throw_timeout, [self])
class Test(): def __init__(self): self.name = None #@async def hello_world(self): print 'async done' #@sync(1) def get_name(self): return self.name #@sync(2) def registry_obj(self, obj): self.obj = obj return True def test3(): # tcpconf = ('tcp',('127.0.0.1',6664)) host = init_host() test = host.spawn_id('1','launch','Test',[]) test.hello_world() host.shutdown() if __name__ == "__main__": start_controller('tasklet') launch(test3)
_sync = {'get_name': '1', 'registry_obj':'2'} _async = ['hello_world'] _ref = [] _parallel = [] def __init__(self): self.name = None def hello_world(self): print 'async done' def get_name(self): return self.name def registry_obj(self, obj): self.obj = obj return True def test3(): # tcpconf = ('tcp',('127.0.0.1',6664)) host = init_host() test = host.spawn_id('1','launch','Test',[]) test.hello_world() if __name__ == "__main__": start_controller('pyactive_thread') launch(test3)
def main(): start_controller('tasklet') launch(test_remote_spawn)