mirror of
https://github.com/python/cpython.git
synced 2025-09-18 14:40:43 +00:00
asyncio: add missing @coroutine decorator
This commit is contained in:
parent
ab1c853079
commit
ed8e3a987e
1 changed files with 2 additions and 0 deletions
|
@ -250,6 +250,7 @@ TCP echo client using the :func:`asyncio.open_connection` function::
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
def tcp_echo_client(message, loop):
|
def tcp_echo_client(message, loop):
|
||||||
reader, writer = yield from asyncio.open_connection('127.0.0.1', 8888,
|
reader, writer = yield from asyncio.open_connection('127.0.0.1', 8888,
|
||||||
loop=loop)
|
loop=loop)
|
||||||
|
@ -379,6 +380,7 @@ Coroutine waiting until a socket receives data using the
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from asyncio.windows_utils import socketpair
|
from asyncio.windows_utils import socketpair
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
def wait_for_data(loop):
|
def wait_for_data(loop):
|
||||||
# Create a pair of connected sockets
|
# Create a pair of connected sockets
|
||||||
rsock, wsock = socketpair()
|
rsock, wsock = socketpair()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue