本文整理汇总了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')
示例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()
示例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!'
示例4: main
def main():
start_controller('pyactive_thread')
launch(test_2pc)
print 'now testing bad...'
launch(test_2pc_bad)
示例5: main
def main():
start_controller("tasklet")
serve_forever(test3)
示例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)
示例7: main
def main():
start_controller('pyactive_thread')
launch(test3)
示例8: main
def main():
start_controller('pyactive_thread')
serve_forever(example1)
示例9: setUp
def setUp(self):
unittest.TestCase.setUp(self)
start_controller('tasklet')
self.host = init_host()
示例10: setUpClass
def setUpClass(self):
tcpconf = ('tcp',('127.0.0.1',6664))
start_controller('pyactive_thread')
self.host = init_host(tcpconf)
示例11: main
def main():
start_controller('pyactive_thread')
launch(test_remote_spawn)
示例12: main
def main():
start_controller('pyactive_thread')
launch(testN)
print 'finish!'
示例13: main
def main():
start_controller('pyactive_thread')
serve_forever(start_test)
print 'hola'
示例14: main
def main():
start_controller('tasklet')
serve_forever(test)
示例15: test
def test():
start_controller("pyactive_thread")
tcpconf = ('tcp',('127.0.0.1',1232))
host = init_host(tcpconf)