diff --git a/docs/language/api.rst b/docs/language/api.rst index ca967a5..fd246a0 100644 --- a/docs/language/api.rst +++ b/docs/language/api.rst @@ -224,6 +224,23 @@ Examples of usage: .. note:: ``assoc`` modifies the datastructure in place and returns ``None``. +await +----- + +``await`` creates an :ref:`await expression `. 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 -----