コード例 #1
0
def main():
    start_controller('pyactive_thread')
    serve_forever(test3)
コード例 #2
0
ファイル: chord.py プロジェクト: sfcelma/pyactive
def main():
    start_controller('pyactive_thread')
    serve_forever(start_node)
コード例 #3
0
ファイル: server.py プロジェクト: sergitoda/pyactive
def main():
    start_controller("tasklet")
    serve_forever(test3)
コード例 #4
0
ファイル: server.py プロジェクト: cloudspaces/pyactive
def main():
    #test3(sys.argv[1])
    start_controller("pyactive_thread")
    serve_forever(test3)
コード例 #5
0
def main():
    start_controller('tasklet')
    serve_forever(start_node)
コード例 #6
0
ファイル: example3.py プロジェクト: cloudspaces/pyactive
def main():
    start_controller('pyactive_thread')
    serve_forever(example1)
コード例 #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()
コード例 #8
0
ファイル: P2.py プロジェクト: EspetecDev/sd-part2
    #  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)
コード例 #9
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()
コード例 #10
0
ファイル: mpaxos_main.py プロジェクト: cloudspaces/pyactive
def main():
    start_controller('tasklet')
    serve_forever(test)
コード例 #11
0
ファイル: actor2.py プロジェクト: cloudspaces/pyactive
"""
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)
コード例 #12
0
ファイル: client.py プロジェクト: cloudspaces/pyactive
def main():
    start_controller("pyactive_thread")
    serve_forever(test3)
コード例 #13
0
ファイル: actor13.py プロジェクト: cloudspaces/pyactive
def main():
    start_controller('pyactive_thread')
    serve_forever(test_registry)
コード例 #14
0
def main():
    start_controller('pyactive_thread')
    serve_forever(start_test)
    print 'hola'
コード例 #15
0
ファイル: test1.py プロジェクト: cloudspaces/pyactive
        

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