We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I was reading the doc about websocket client :
session = aiohttp.ClientSession() async with session.ws_connect('http://example.org/websocket') as ws: async for msg in ws: if msg.tp == aiohttp.MsgType.text: if msg.data == 'close cmd': await ws.close() break else: ws.send_str(msg.data + '/answer') elif msg.tp == aiohttp.MsgType.closed: break elif msg.tp == aiohttp.MsgType.error: break
But it seems that async is deprecated now. How to make this code working with python 3.5 ?
async
The text was updated successfully, but these errors were encountered:
The snippet is 100% correct and works on Python 3.5+
asyncio.async coroutine is deprecated for sake of async def, async with and async for keywords.
asyncio.async
async def
async with
async for
Sorry, something went wrong.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that new issue.
No branches or pull requests
Hi,
I was reading the doc about websocket client :
But it seems that
async
is deprecated now. How to make this code working with python 3.5 ?The text was updated successfully, but these errors were encountered: