当前位置: 首页>>代码示例>>Python>>正文


Python controller.start_controller函数代码示例

本文整理汇总了Python中pyactive.controller.start_controller函数的典型用法代码示例。如果您正苦于以下问题:Python start_controller函数的具体用法?Python start_controller怎么用?Python start_controller使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了start_controller函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_host

def create_host():
    start_controller("pyactive_thread")
    tcpconf = ('tcp', ('127.0.0.1', 9899))
    global host
    host = init_host(tcpconf)
    global remote_host
    remote_host = host.lookup(settings.PYACTIVE_URL+'controller/Host/0')
开发者ID:iostackproject,项目名称:Crystal-Controller,代码行数:7,代码来源:views.py

示例2: test

def test():
    lP = []
    lA = []
    lL = []
    start_controller('pyactive_thread')
    host = init_host()
#     log = host.spawn_id('log', 'main', 'LogUML', [])
#     host.set_tracer(log)
#     interval(1, save_log, log)
    for i in range(0, N_LEARNERS):
        l = host.spawn_id(str(i), 'paxos_protocol', 'Learner',[N_ACCEPTORS])
        lL.append(l)
    for i in range(0, N_ACCEPTORS):
        a = host.spawn_id(str(i+N_LEARNERS), 'paxos_protocol', 'Acceptor', [N_ACCEPTORS])
        a.set_multi(lL)
        lA.append(a)    
    for i in range(0,N_PROPOSERS):
        p = host.spawn_id(str(i+N_LEARNERS+N_ACCEPTORS+5), 'paxos_protocol', 'Proposer', [N_ACCEPTORS])
        
        num = int(random.random() * 100)
        print i, num
        p.set_proposal(num)
        lP.append(p)
    lP[0].set_multi([lA[0], lA[1],lA[2]])
    lP[1].set_multi([lA[2], lA[3],lA[4]])
    lP[2].set_multi([lA[0], lA[1],lA[2]])
    lP[3].set_multi([lA[2], lA[3],lA[4]])
#     p = AMulti(lP)
#     p.prepare()
    lP[3].prepare()
    lP[0].prepare()
    lP[1].prepare()
    lP[2].prepare()
开发者ID:raqueleyeos,项目名称:pyactive,代码行数:33,代码来源:main.py

示例3: main

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!'
开发者ID:sergitoda,项目名称:pyactive,代码行数:9,代码来源:ring3.py

示例4: main

def main():
    start_controller('pyactive_thread')
    launch(test_2pc)
    print 'now testing bad...'
    launch(test_2pc_bad)
开发者ID:cloudspaces,项目名称:pyactive,代码行数:5,代码来源:2pc_multi.py

示例5: main

def main():
    start_controller("tasklet")
    serve_forever(test3)
开发者ID:sergitoda,项目名称:pyactive,代码行数:3,代码来源:server.py

示例6: setUpClass

 def setUpClass(cls):
     super(Test, cls).setUpClass()
     tcpconf = ('tcp',('127.0.0.1',6842))
     start_controller('pyactive_thread')
     cls.host = init_host(tcpconf)
开发者ID:sergitoda,项目名称:pyactive,代码行数:5,代码来源:test_remote.py

示例7: main

def main():
    start_controller('pyactive_thread')
    launch(test3)
开发者ID:cloudspaces,项目名称:pyactive,代码行数:3,代码来源:fourth.py

示例8: main

def main():
    start_controller('pyactive_thread')
    serve_forever(example1)
开发者ID:cloudspaces,项目名称:pyactive,代码行数:3,代码来源:example3.py

示例9: setUp

 def setUp(self):
     unittest.TestCase.setUp(self)
     start_controller('tasklet')
     self.host = init_host()
开发者ID:sergitoda,项目名称:pyactive,代码行数:4,代码来源:ring2.py

示例10: setUpClass

 def setUpClass(self):
     tcpconf = ('tcp',('127.0.0.1',6664))
     start_controller('pyactive_thread')
     self.host = init_host(tcpconf)
开发者ID:cloudspaces,项目名称:pyactive,代码行数:4,代码来源:test_remote.py

示例11: main

def main():
    start_controller('pyactive_thread')
    launch(test_remote_spawn)
开发者ID:cloudspaces,项目名称:pyactive,代码行数:3,代码来源:remote_host.py

示例12: main

def main():
    start_controller('pyactive_thread')
    launch(testN)
    print 'finish!'
开发者ID:cloudspaces,项目名称:pyactive,代码行数:4,代码来源:ring3.py

示例13: main

def main():
    start_controller('pyactive_thread')
    serve_forever(start_test)
    print 'hola'
开发者ID:iostackproject,项目名称:Crystal-Controller,代码行数:4,代码来源:test.py

示例14: main

def main():
    start_controller('tasklet')
    serve_forever(test)
开发者ID:cloudspaces,项目名称:pyactive,代码行数:3,代码来源:mpaxos_main.py

示例15: test

def test():
    start_controller("pyactive_thread")
    tcpconf = ('tcp',('127.0.0.1',1232))
    host = init_host(tcpconf)
开发者ID:cloudspaces,项目名称:pyactive,代码行数:4,代码来源:remote_hserver.py


注:本文中的pyactive.controller.start_controller函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。