-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shared recordings 1: exposing
recording_id
in Rust SDK (#4383)
We already exposed a way of configuring the `StoreId`, but this is an internal concept that we have never communicated anywhere and is very likely to be unstable as the way we do blueprint recordings evolve (also it's been known to confuse users). This adds a simple, straightforward way of configuring the `recording_id`, akin to what we have in the Python SDK. --- Part of a PR series to fix #4055 once and for all: - #4383 - #4384 - #4385
- Loading branch information
Showing
5 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "shared_recording" | ||
version = "0.12.0-alpha.1+dev" | ||
edition = "2021" | ||
rust-version = "1.72" | ||
license = "MIT OR Apache-2.0" | ||
publish = false | ||
|
||
[dependencies] | ||
rerun = { path = "../../../crates/rerun" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Shared Recording | ||
rust: https://github.com/rerun-io/rerun/tree/latest/examples/python/shared_recording/main.py?speculative-link | ||
--- | ||
|
||
<picture> | ||
<img src="https://static.rerun.io/shared_recording/c3da85f1d4c158b8c7afb6bd3278db000b58049d/full.png" alt=""> | ||
<source media="(max-width: 480px)" srcset="https://static.rerun.io/shared_recording/c3da85f1d4c158b8c7afb6bd3278db000b58049d/480w.png"> | ||
<source media="(max-width: 768px)" srcset="https://static.rerun.io/shared_recording/c3da85f1d4c158b8c7afb6bd3278db000b58049d/768w.png"> | ||
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/shared_recording/c3da85f1d4c158b8c7afb6bd3278db000b58049d/1024w.png"> | ||
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/shared_recording/c3da85f1d4c158b8c7afb6bd3278db000b58049d/1200w.png"> | ||
</picture> | ||
|
||
This example demonstrates how to use `RecordingId`s to create a single shared recording across multiple processes. | ||
|
||
Run the following multiple times, and you'll see that each invocation adds data to the existing recording rather than creating a new one: | ||
```bash | ||
cargo run | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! Demonstrates how to use `RecordingId`s to build a single recording from multiple processes. | ||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let rec = rerun::RecordingStreamBuilder::new("rerun_example_shared_recording") | ||
.recording_id("my_shared_recording") | ||
.spawn()?; | ||
|
||
rec.log( | ||
"updates", | ||
&rerun::TextLog::new(format!("hello from process #{}", std::process::id())), | ||
)?; | ||
|
||
Ok(()) | ||
} |