diff options
Diffstat (limited to 'examples/echo_server_tulip.py')
-rw-r--r-- | examples/echo_server_tulip.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/echo_server_tulip.py b/examples/echo_server_tulip.py index 8167e54..d7e6e29 100644 --- a/examples/echo_server_tulip.py +++ b/examples/echo_server_tulip.py @@ -1,13 +1,14 @@ -import asyncio +import trollius as asyncio +from trollius import From @asyncio.coroutine def echo_server(): - yield from asyncio.start_server(handle_connection, 'localhost', 8000) + yield From(asyncio.start_server(handle_connection, 'localhost', 8000)) @asyncio.coroutine def handle_connection(reader, writer): while True: - data = yield from reader.read(8192) + data = yield From(reader.read(8192)) if not data: break writer.write(data) |