docs/asyncio: Document new ensure_future() and deprecated async()

This commit is contained in:
Yury Selivanov 2015-05-11 16:33:41 -04:00
parent 7185461897
commit d7e19bb566
3 changed files with 28 additions and 20 deletions

View file

@ -364,7 +364,7 @@ Simple example querying HTTP headers of the URL passed on the command line::
url = sys.argv[1]
loop = asyncio.get_event_loop()
task = asyncio.async(print_http_headers(url))
task = asyncio.ensure_future(print_http_headers(url))
loop.run_until_complete(task)
loop.close()