Exemple #1
0
def main():
    start_controller('pyactive_thread')
    serve_forever(test3)
Exemple #2
0
def main():
    start_controller('pyactive_thread')
    serve_forever(start_node)
Exemple #3
0
def main():
    start_controller("tasklet")
    serve_forever(test3)
Exemple #4
0
def main():
    #test3(sys.argv[1])
    start_controller("pyactive_thread")
    serve_forever(test3)
Exemple #5
0
def main():
    start_controller('tasklet')
    serve_forever(start_node)
Exemple #6
0
def main():
    start_controller('pyactive_thread')
    serve_forever(example1)
Exemple #7
0
"""
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()
Exemple #8
0
    #  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()
Exemple #10
0
def main():
    start_controller('tasklet')
    serve_forever(test)
Exemple #11
0
"""
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)
Exemple #12
0
def main():
    start_controller("pyactive_thread")
    serve_forever(test3)
Exemple #13
0
def main():
    start_controller('pyactive_thread')
    serve_forever(test_registry)
def main():
    start_controller('pyactive_thread')
    serve_forever(start_test)
    print 'hola'
Exemple #15
0
        

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)
Exemple #16
0
def main():
    start_controller('tasklet')
    serve_forever(test3)