예제 #1
0
def test_calculator_gc():
    def new_evaluate_impl(old_evaluate_impl):
        def call(*args, **kwargs):
            gc.collect()
            return old_evaluate_impl(*args, **kwargs)
        return call

    read, write = socket.socketpair(socket.AF_UNIX)

    # inject a gc.collect to the beginning of every evaluate_impl call
    evaluate_impl_orig = calculator_server.evaluate_impl
    calculator_server.evaluate_impl = new_evaluate_impl(evaluate_impl_orig)

    server = capnp.TwoPartyServer(write, bootstrap=calculator_server.CalculatorImpl())
    calculator_client.main(read)

    calculator_server.evaluate_impl = evaluate_impl_orig
예제 #2
0
def test_calculator_gc():
    def new_evaluate_impl(old_evaluate_impl):
        def call(*args, **kwargs):
            gc.collect()
            return old_evaluate_impl(*args, **kwargs)

        return call

    read, write = socket.socketpair(socket.AF_UNIX)

    # inject a gc.collect to the beginning of every evaluate_impl call
    evaluate_impl_orig = calculator_server.evaluate_impl
    calculator_server.evaluate_impl = new_evaluate_impl(evaluate_impl_orig)

    server = capnp.TwoPartyServer(write, calculator_server.restore)
    calculator_client.main(read)

    calculator_server.evaluate_impl = evaluate_impl_orig
예제 #3
0
def test_calculator():
    read, write = socket.socketpair(socket.AF_UNIX)

    server = capnp.TwoPartyServer(write,
                                  bootstrap=calculator_server.CalculatorImpl())
    calculator_client.main(read)
예제 #4
0
def test_calculator():
    read, write = socket.socketpair(socket.AF_UNIX)

    server = capnp.TwoPartyServer(write, bootstrap=calculator_server.CalculatorImpl())
    calculator_client.main(read)
예제 #5
0
def test_calculator():
    read, write = socket.socketpair(socket.AF_UNIX)

    server = capnp.TwoPartyServer(write, calculator_server.restore)
    calculator_client.main(read)
예제 #6
0
def test_calculator():
    read, write = socket.socketpair(socket.AF_UNIX)

    server = capnp.TwoPartyServer(write, calculator_server.restore)
    calculator_client.main(read)