-
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.
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
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,25 @@ | ||
[package] | ||
name = "re_rrdp_comms" | ||
authors.workspace = true | ||
description = "Client comms for RRDP GRPC server" | ||
edition.workspace = true | ||
homepage.workspace = true | ||
include.workspace = true | ||
license.workspace = true | ||
publish = true | ||
readme = "README.md" | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
|
||
|
||
[dependencies] | ||
re_log.workspace = true | ||
re_log_types.workspace = true | ||
re_smart_channel.workspace = true |
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 @@ | ||
# re_ws_comms | ||
|
||
Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. | ||
|
||
[![Latest version](https://img.shields.io/crates/v/re_ws_comms.svg)](https://crates.io/crates/re_ws_comms) | ||
[![Documentation](https://docs.rs/re_ws_comms/badge.svg)](https://docs.rs/re_ws_comms) | ||
![MIT](https://img.shields.io/badge/license-MIT-blue.svg) | ||
![Apache](https://img.shields.io/badge/license-Apache-blue.svg) | ||
|
||
Client-side grpc communication library with an RRDP server. |
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,20 @@ | ||
//! Communications with an RRDP GRPC server. | ||
use re_log_types::LogMsg; | ||
|
||
/// Stream an rrd file from an RRDP server. | ||
/// | ||
/// `on_msg` can be used to wake up the UI thread on Wasm. | ||
pub fn stream_recording( | ||
url: String, | ||
_on_msg: Option<Box<dyn Fn() + Send + Sync>>, | ||
) -> re_smart_channel::Receiver<LogMsg> { | ||
let (tx, rx) = re_smart_channel::smart_channel( | ||
re_smart_channel::SmartMessageSource::RrdpStream { url: url.clone() }, | ||
re_smart_channel::SmartChannelSource::RrdpStream { url: url.clone() }, | ||
); | ||
|
||
// TODO(jleibs): Implement the actual streaming logic here | ||
|
||
rx | ||
} |