-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Description
The only current async runtime supported is Tokio. We use it as an I/O event loop, I/O resource provider (TcpStream, UdpSocket), and task executor (tokio::spawn). We also use some of its utils like channels and timers etc, but those can run independently of the runtime.
To allow msg-rs to be run with other, potentially more performance async runtimes (compio, monoio, we'd need a way to abstract the runtime into a trait. This trait should contain methods for spawning tasks onto the specified runtime (with various variations, like maybe spawn_blocking if needed, or spawning on a JoinSet), but it should also contain type associations for resources like TcpStream and so on. This is because most of them have different ways of interacting with the OS event systems (epoll vs. io_uring for example).
This is just for starters, not a definitive guide. There may be more involved.
The user should not be aware of this functionality unless they need it. We can run with tokio by default.