-
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
Make it possible to open http-streamed RRDs in follow mode via JS API. #6326
Conversation
7e7e406
to
bc12f57
Compare
rerun_js/web-viewer/index.js
Outdated
*/ | ||
open(rrd) { | ||
open(rrd, follow_if_http = false) { |
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.
Putting a flag this specific onto a generic-sounding open
call makes me uneasy, but it's fine if we plan to remove it at some point
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.
Hmm, yeah. These things tend to last longer than we'd like though.
Anything we could do to improve?
Would it be better as a different API like open_and_follow
?
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.
I'm not sure 😅. Maybe this could be in an options object:
/** @param {{ follow_if_http?: boolean }} options */
open(rrd, options) {
// ...
this.#handle.add_receiver(url, options.follow_if_http);
}
This way we can add more flags in a backwards compatible way
#6326) ### What - Resolves: #6243 In the context of the Gradio integration, although we are streaming over http, from the perspective of system operation it feels more like a websocket. In many situations we want new data to update immediately once computation is done, rather than playing over time abstract time domain. Eventually we would like to control all of this behavior through blueprint, but moving TimeControls to blueprint is a lot more work. We already use the SmartChannelSource to make the determination of follow mode, so with a little bit of additional plumbing, it's possible for us to indicate this from the js API. This is a pretty advanced edge-case and so I haven't exposed it to the other mechanism through which an http source might be added. I assume this will eventually be removed again once we have TimeControls available via blueprint. ### 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/6326?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/6326?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/6326) - [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
In the context of the Gradio integration, although we are streaming over http, from the perspective of system operation it feels more like a websocket. In many situations we want new data to update immediately once computation is done, rather than playing over time abstract time domain.
Eventually we would like to control all of this behavior through blueprint, but moving TimeControls to blueprint is a lot more work. We already use the SmartChannelSource to make the determination of follow mode, so with a little bit of additional plumbing, it's possible for us to indicate this from the js API.
This is a pretty advanced edge-case and so I haven't exposed it to the other mechanism through which an http source might be added. I assume this will eventually be removed again once we have TimeControls available via blueprint.
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.