Ejemplo n.º 1
0
# -*- Mode: Python -*-

import coro
import echo_server

port = 9000
coro.write_stderr ('starting echo server on port %d\n' % (port,))
server = echo_server.echo_server (port)
coro.spawn (server.go)
coro.write_stderr ('starting event loop\n')
coro.event_loop()
coro.write_stderr ('exited event loop\n')
def init_server(request):
    """
    Launch the echo server, but don't start blocking until
    the testing session is over!
    """
    request.addfinalizer(echo_server().join)