Пример #1
0
def test_zmq_drive_bind_server():

    reply_server_thread = ReplyServerThread(lambda t: 100)
    reply_server_thread.start()
    singlepop(basic_steady_state,
              bgfr=RequestConnection(reply_server_thread.port))
    reply_server_thread.shutdown()
Пример #2
0
def test_zmq_drive_bind_server():

    try:
        # Start reply server:
        reply_server_thread = ReplyServerThread(lambda t: 100)
        reply_server_thread.start()


        # Run test:
        singlepop(basic_steady_state, bgfr=RequestFiringRate(reply_server_thread.port))

    finally:
        import zmq
        socket = zmq_context.socket(zmq.REQ)
        socket.connect("tcp://localhost:%s" % reply_server_thread.port)
        socket.send('SHUTDOWN')
        message = socket.recv()
        assert message == 'DOWN'
        time.sleep(.1)
        assert reply_server_thread.is_alive() == False
Пример #3
0
def test_zmq_nsyn():
    reply_server_thread = ReplyServerThread(lambda: 1)
    reply_server_thread.start()
    singlepop(basic_steady_state,
              nsyn=RequestConnection(reply_server_thread.port))
    reply_server_thread.shutdown()
Пример #4
0
def test_zmq_drive_bind_server():

    reply_server_thread = ReplyServerThread(lambda t: 100)
    reply_server_thread.start()
    singlepop(basic_steady_state, bgfr=RequestConnection(reply_server_thread.port))
    reply_server_thread.shutdown()
Пример #5
0
def test_zmq_nsyn():
    reply_server_thread = ReplyServerThread(lambda: 1)
    reply_server_thread.start()
    singlepop(basic_steady_state, nsyn=RequestConnection(reply_server_thread.port))
    reply_server_thread.shutdown()