You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Currently, the `ws_receiver_blocking` function would always sleep after
every read. Additionally, it did not use the value from
`options.delay_blocking` for the sleep delay. This would result in that
thread being blocked for 10ms _after every read_ no matter what the user
configured it to, meaning it would receive data at an unnecessarily slow
rate.
In this PR:
- Instead of using `set_nonblocking` or calling `std::thread::sleep`
after every read, we now use `set_read_timeout` in the non-tokio native
impls.
- The `delay_blocking` option is removed in favor of `read_timeout`
- The default for `read_timeout` is `Some(10ms)`
- The ideal thing to do here would be to not block at all and instead
use native polling APIs. This work is left as a TODO for another PR.
- #49
On native, we always block the thread using a
thread::sleep
/thread::yield_now
after a read. The reason wesleep
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.The text was updated successfully, but these errors were encountered: