rio
rio copied to clipboard
How does this library help batching syscalls for network I/O?
I am new to this library and I am trying to figure out how does this library help batching syscalls for network I/O. my use case is I am trying to use this library to broadcast a stream of messages m1,m2, m3....to all the connected sockets of my server. so if there are 1000 clients connected to my server I want to broadcast each message to all 1000 and I am trying to accomplish this is in as few syscalls as possible because called syscall.send on every socket descriptor seems to be the bottleneck of my server to scale. Latency is very important for my app.
Below are my questions/comments about rio library
- does calling
ring.write_atmakes a syscall? I am assuming the answer is no since it returns a Future however I assume callingring.write_at.await?will make a syscall. so if I need to batch I need to callring.write_atfor each individual message I want to broadcast and add then callring.submit_all? but then what I do with each each individual future I get from callingring.write_at? - How do I handle backpressure in my app if the submission queue is full? what I do? just keep retrying forever?