-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite re_ws_comms
to work without async
& tokio
runtime
#6005
Conversation
re_ws_comms
to work without async
& tokio
runtime
Deployed docs
|
indexmap = "2.1" # Version chosen to align with other dependencies | ||
indicatif = "0.17.7" # Progress bar | ||
infer = "0.15" # infer MIME type by checking the magic number signaturefer MIME type by checking the magic number signature | ||
indexmap = "2.1" # Version chosen to align with other dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my local formatter had different ideas I guess. All I wanted to do is sort some dependencies
/// Handle to keep the [`re_ws_comms::RerunServer`] alive | ||
_rerun_server: RerunServerHandle, | ||
/// Rerun websocket server. | ||
_rerun_server: RerunServer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that there's no distinction between RerunServer
and RerunServerHandle
now
…e on new connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
77f7638
to
3687ec9
Compare
#6030) ### What * Followup to #6005 * another piece of #5907 Removes tokio dependency from re_web_viewer_server: * async `WebViewerServer` no longer uses tokio internally, instead use `future_channel::oneshot` for shutdown * `WebViewerServerHandle` is now optional (but default enabled) and spawns a thread that internally uses the tiny pollster crate * removed `re_web_viewer_server`'s main file - it's not used by any test and may thus rot * this allows us to also remove the clap dependency from this crate⚠️ Rerun serve/connect still needs a tokio runtime with this change⚠️ : Likely the last piece after this is `re_sdk_comms` which is very similar in nature to `re_ws_comms`. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6030?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6030?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/6030) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
What
tokio
#5907Removes tokio & async code from re_ws_comms. Achieves this by spawning a thread for listening and another one for relaying messages (the later was already the case but via tokio).
Main disadvantage of this change here is that all clients now share the same thread for sending whereas before this was handled by the tokio pool. In theory we have less latency though since before we had to go from the broadcast thread to the client worker threads in a separate step.
Ended up depending on the
polling
crate because otherwise shutting down a tcplistener with vanilla std rust is close to impossible. The version I picked is such that Cargo.lock doesn't have (yet) another instance of this crate.This change fixes a bug in the process where we'd not send all so far received messages to new clients.
Testing done:
pixi run rerun-web <some rrd>
to serve several local browserspixi run python .\examples\python\face_tracking\main.py --serve
to serve several local browsers and checking that they catch up on old dataChecklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.