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