On native, we always block the thread using a thread::sleep/thread::yield_now after a read. The reason we sleep on those threads is to not busy-loop that CPU core. We should instead set the socket to non-blocking mode and poll it using native polling APIs. This would be useful for senders as well.
We use polling in Rerun, and it has a reasonably small footprint, so should be fine to add as a dependency here as well.
On native, we always block the thread using a
thread::sleep/thread::yield_nowafter a read. The reason wesleepon those threads is to not busy-loop that CPU core. We should instead set the socket to non-blocking mode and poll it using native polling APIs. This would be useful for senders as well.We use
pollingin Rerun, and it has a reasonably small footprint, so should be fine to add as a dependency here as well.