diff -r 180e4b678003 Doc/library/asyncio-task.rst --- a/Doc/library/asyncio-task.rst Mon Feb 17 00:02:43 2014 +0100 +++ b/Doc/library/asyncio-task.rst Mon Feb 17 14:34:11 2014 +0800 @@ -229,7 +229,7 @@ @asyncio.coroutine def slow_operation(future): yield from asyncio.sleep(1) - future.set_result('Future in done!') + future.set_result('Future is done!') loop = asyncio.get_event_loop() future = asyncio.Future() @@ -261,7 +261,7 @@ @asyncio.coroutine def slow_operation(future): yield from asyncio.sleep(1) - future.set_result('Future in done!') + future.set_result('Future is done!') def got_result(future): print(future.result()) @@ -272,6 +272,7 @@ asyncio.Task(slow_operation(future)) future.add_done_callback(got_result) loop.run_forever() + loop.close() In this example, the future is responsible to display the result and to stop the loop.