M
Modular9mo ago
a2svior

Async function docs?

Hi! I found a mention of async fn and async def in the roadmap document, but no description of how these actually work? Does Mojo support any sort of async/await workflow? The only mention of async I see is in the changelog and just a tiny bit in the code of the coroutine in the standard library. Can we have better documentation for this?
4 Replies
TheCodeMeister
TheCodeMeister9mo ago
I have this question too.... Also... I would also like to know if async await in mojo are only for io ?
Ehsan M. Kermani (Modular)
Here is more https://docs.modular.com/mojo/changelog#week-of-2023-01-30 and yes, async is usually used for IO
Mojo🔥 changelog | Modular Docs
A history of significant Mojo changes.
a2svior
a2sviorOP9mo ago
Yes, I've seen this changelog, thanks! Would still be good to have more details on how async functions work. Will try to formulate more specific questions
Melody Daniel
Melody Daniel9mo ago
To use asynchronous functionalities you need a runtime to drive the coroutines. Any runtime Modular has created is for internal use and is not bundled with the language, as such there are no Mojo async runtimes atm. Also, Mojo's coroutine API is different from Python's so I don't think using a Python runtime like AsyncIO will work
Want results from more Discord servers?
Add your server