MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / forward_stream_to_channel

Function forward_stream_to_channel

crates/python/src/py_api/mod.rs:100–109  ·  view source on GitHub ↗
(
    mut stream: RustJsonStream,
    tx: tokio::sync::mpsc::Sender<FlowResult<serde_json::Value>>,
)

Source from the content-addressed store, hash-verified

98}
99
100pub(crate) async fn forward_stream_to_channel(
101 mut stream: RustJsonStream,
102 tx: tokio::sync::mpsc::Sender<FlowResult<serde_json::Value>>,
103) {
104 while let Some(item) = stream.next().await {
105 if tx.send(item).await.is_err() {
106 break;
107 }
108 }
109}
110
111// ---------------------------------------------------------------------------
112// Scope stack creation

Calls 2

nextMethod · 0.45
sendMethod · 0.45