def main(): start_controller('pyactive_thread') serve_forever(test3)
def main(): start_controller('pyactive_thread') serve_forever(start_node)
def main(): start_controller("tasklet") serve_forever(test3)
def main(): #test3(sys.argv[1]) start_controller("pyactive_thread") serve_forever(test3)
def main(): start_controller('tasklet') serve_forever(start_node)
def main(): start_controller('pyactive_thread') serve_forever(example1)
""" Author: Pedro Garcia Lopez <*****@*****.**> """ from pyactive.controller import init_host, serve_forever tcpconf = ('tcp', ('127.0.0.1', 1232)) host = init_host(tcpconf) serve_forever()
# create bds for i in range(bds): index = sl_division * i bd.append(host.spawn_id(str(i), 'P2', 'Bd', [sl_division, index, streetLights])) # create streetLights for i in range(streetLights): st.append(host.spawn_id(str(i), 'P2', 'StreetLight', [i % bds])) # create server for i in range(servers): serv.append(host.spawn_id(str(i), 'P2', 'Server', [st, log, i, bd])) # create queue queue = host.spawn_id('1', 'P2', 'Queue', [serv, servers]) # Sensor.start('signal.txt') s = host.spawn_id('1', 'P2', 'Sensor', [st, log]) for i in range(streetLights): st[i].set_queue(queue, i) s.start(wd + '/input.txt') print '=====[SERVER START]=====' if __name__ == '__main__': start_controller('pyactive_thread') serve_forever(send)
""" Author: Pedro Garcia Lopez <*****@*****.**> """ from pyactive.controller import init_host, serve_forever tcpconf = ('tcp',('127.0.0.1',1232)) host = init_host(tcpconf) serve_forever()
def main(): start_controller('tasklet') serve_forever(test)
""" Author: Pedro Garcia Lopez <*****@*****.**> """ from pyactive.controller import init_host, serve_forever,start_controller, sleep class Echo: _sync = {} _async = ['echo'] _parallel = [] _ref = [] def echo(self,msg): print msg def test(): tcpconf = ('tcp',('127.0.0.1',1237)) host = init_host(tcpconf) e1 = host.spawn_id('1', 'actor2', 'Echo', []) if __name__ == '__main__': start_controller('pyactive_thread') serve_forever(test)
def main(): start_controller("pyactive_thread") serve_forever(test3)
def main(): start_controller('pyactive_thread') serve_forever(test_registry)
def main(): start_controller('pyactive_thread') serve_forever(start_test) print 'hola'
class Calc(object): _sync = {} _async = ['add'] _parallel = [] _ref = [] def __init__(self, hola=None): self.hola = hola def add(self, x, y): print x+y def test1(): calc = [] tcpconf = ('tcp',('127.0.0.1',6664)) host = init_host(tcpconf) for i in range(4): calc.append(host.spawn_id(str(i),'test1','Calc',[])) server = host.spawn_id(str(30),'test1','Server',[]) server.add_atoms(calc) server.add(4,4) if __name__ == '__main__': start_controller('pyactive_thread') serve_forever(test1)
def main(): start_controller('tasklet') serve_forever(test3)