示例#1
0
def start_server(port):

    rules = [{
        'command': 'reply',
        'handler': (STRATEGY_QUEUE, handlers.ReplyHandler)
    }]
    router = moebius.ZMQRouter(rules)
    srv = moebius.ZMQServer('tcp://127.0.0.1:%s' % port, router)
    print 'Server started'
    srv.start()
示例#2
0
def start_server(port):
    logger.debug("PID: %d, PPID: %d" % (os.getpid(), os.getppid()))
    rules = [{
        'command': 'reply',
        'handler': (STRATEGY_QUEUE, handlers.ReplyHandler)
    }]
    router = moebius.ZMQRouter(rules)
    srv = moebius.ZMQServer('tcp://127.0.0.1:%s' % port, router)
    print 'Server started'
    srv.start()
示例#3
0
def start_server(port):

    rules = [{
        'command': 'reply',
        'handler': (STRATEGY_QUEUE, handlers.ReplyHandler3)
    }]
    router = moebius.ZMQRouter(rules)
    broom = moebius.Broom(classname=moebius.ZMQServer,
                          router=router,
                          workers=40,
                          tmpdir="tmp")

    srv = moebius.BroomServer('tcp://127.0.0.1:%s' % port, broom, 1)
    print 'Server created'
    srv.start()
示例#4
0
def start_server(port):
    logger.debug("PID: %d, PPID: %d" % (os.getpid(), os.getppid()))
    rules = [{
        'command': 'reply',
        'handler': (STRATEGY_QUEUE, handlers.ReplyHandler3)
    }]
    router = moebius.ZMQRouter(rules)
    broom = moebius.Broom(classname=moebius.ZMQServer,
                          router=router,
                          workers=5,
                          tmpdir="tmp")
    broom.run()

    srv = moebius.BroomServer('tcp://127.0.0.1:%s' % port, broom, 1)
    print 'Server created'
    srv.start()
示例#5
0
def start_server(port):
    router = moebius.ZMQRouter(rules)
    srv = moebius.ZMQServer('tcp://127.0.0.1:%s' % port, router)
    print 'Server started'
    srv.start()