Skip to content
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

Merged
merged 4 commits into from
May 15, 2024

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented May 14, 2024

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

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

To run all checks from main, comment on the PR with @rerun-bot full-check.

@jleibs jleibs added enhancement New feature or request 🕸️ web regarding running the viewer in a browser include in changelog labels May 14, 2024
@jleibs jleibs marked this pull request as ready for review May 14, 2024 19:03
*/
open(rrd) {
open(rrd, follow_if_http = false) {
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

@jprochazk jprochazk May 15, 2024

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

@jleibs jleibs merged commit a869562 into main May 15, 2024
33 of 34 checks passed
@jleibs jleibs deleted the jleibs/follow_streaming branch May 15, 2024 14:04
jleibs added a commit that referenced this pull request May 15, 2024
#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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request include in changelog 🕸️ web regarding running the viewer in a browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible for a an http-streamed RRD to end up in follow mode
2 participants