Merge pull request #1797 from Kodiologist/doc-await

Document `await`
This commit is contained in:
Ryan Gonzalez 2019-07-18 11:49:13 -05:00 committed by GitHub
commit e777f25796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -224,6 +224,23 @@ Examples of usage:
.. note:: ``assoc`` modifies the datastructure in place and returns ``None``.
await
-----
``await`` creates an :ref:`await expression <py:await>`. It takes exactly one
argument: the object to wait for.
::
=> (import asyncio)
=> (defn/a main []
... (print "hello")
... (await (asyncio.sleep 1))
... (print "world"))
=> (asyncio.run (main))
hello
world
break
-----