More details on `TaskGroup` and async
Hi @Caroline @Jack Clayton , are there any details avaialble on the implementation and/or usage of the
TaskGroup
or on how to use async/schedule tasks to run concurrently in Mojo at the moment? The only example I found is this explanation by Jack https://discord.com/channels/1087530497313357884/1276206591510843443/1276210757792436234 , wondering if y'all can provide more insights?
E.g. is it possible to await tasks one by one and not the whole group at once?5 Replies
The use-case I have in mind is non-blocking networking in Lightbug. Potentially looking at implementing some simple analogue of Mio in Rust https://docs.rs/mio/1.0.2/mio/index.html , to that point also wondering if there is some event polling availiable in Mojo that we don't see in
stdlib
or if I have to rely on epoll
/kqueue
?mio - Rust
Mio is a fast, low-level I/O library for Rust focusing on non-blocking APIs and event notification for building high performance I/O apps with as little overhead as possible over the OS abstractions.
Think the work going on in async at the moment is going on at the compiler level.
MIO has a bunch of mistakes (from our current perspective). It essentially can’t use io_uring.
I’m slowly moving towards this but I need some more stuff in coroutines before I can implement it in a reasonable way.
you probably saw this, right? @Owen Hilyard https://github.com/dmitry-salin/io_uring
GitHub
GitHub - dmitry-salin/io_uring: The io_uring library for Mojo
The io_uring library for Mojo. Contribute to dmitry-salin/io_uring development by creating an account on GitHub.
Yes, I did