Exemplo n.º 1
0
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!'
Exemplo n.º 2
0
 def test_load_oneway(self):
     launch(test1, [self])
     launch(testN, [self])
Exemplo n.º 3
0
def main():
    start_controller('pyactive_thread')
    launch(client_test)
Exemplo n.º 4
0
def main():
    start_controller('tasklet')
    launch(test3)
Exemplo n.º 5
0
def main():
    start_controller('tasklet')
    launch(test_2pc)
    print 'now testing bad...'
Exemplo n.º 6
0
def main():
    start_controller('tasklet')
    launch(test3)
Exemplo n.º 7
0
 def test_hello(self):
     launch(test_hello, [self])
Exemplo n.º 8
0
 def test_registry_object(self):
     launch(test_registry_object, [self])
Exemplo n.º 9
0
def main():
    start_controller('pyactive_thread')
    launch(test_remote_spawn)
Exemplo n.º 10
0
def main():
    start_controller("tasklet")
    launch(test_remote_spawn)
Exemplo n.º 11
0
def main():
    start_controller('tasklet')
    launch(client_test)
Exemplo n.º 12
0
def main():
    start_controller('pyactive_thread')
    launch(testN)
    print 'finish!'
Exemplo n.º 13
0
 def test_registry_object(self):
     launch(test_registry_object, [self])
Exemplo n.º 14
0
def main():
    start_controller('pyactive_thread')
    launch(test_2pc)
    print 'now testing bad...'
    launch(test_2pc_bad)
Exemplo n.º 15
0
 def test_load_oneway_N(self):
     launch(testN,[self])
Exemplo n.º 16
0
 def test_load_oneway(self):
     launch(test1,[self])
Exemplo n.º 17
0
    _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)
Exemplo n.º 18
0
def main():
    start_controller('pyactive_thread')
    launch(test_log)
Exemplo n.º 19
0
def main():
    start_controller('pyactive_thread')
    launch(test3)
Exemplo n.º 20
0
def main():
    start_controller('tasklet')
    launch(client_test)
Exemplo n.º 21
0
 def test_throw_timeout(self):
     launch(test_throw_timeout, [self])
Exemplo n.º 22
0
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)
Exemplo n.º 23
0
    _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)
Exemplo n.º 24
0
def main():
    start_controller('tasklet')
    launch(test_remote_spawn)