]> granicus.if.org Git - python/commitdiff
asyncio doc: rewrite the callback hello world to use call_soon() instead of a
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 10 Dec 2013 01:47:22 +0000 (02:47 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 10 Dec 2013 01:47:22 +0000 (02:47 +0100)
direct call.

Doc/library/asyncio-eventloop.rst

index c5dbb3ba25ed06b0ccc9c821947cd01cc5ed1776..95a83440805105841f55d7739a89b83b0c80d662 100644 (file)
@@ -348,7 +348,7 @@ Print ``Hello World`` every two seconds, using a callback::
         loop.call_later(2, print_and_repeat, loop)
 
     loop = asyncio.get_event_loop()
-    print_and_repeat(loop)
+    loop.call_soon(print_and_repeat, loop)
     loop.run_forever()
 
 .. seealso::