Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3486288
D6284.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
983 B
Referenced Files
None
Subscribers
None
D6284.diff
View Options
diff --git a/shared/tunnelbroker-client/src/lib.rs b/shared/tunnelbroker-client/src/lib.rs
--- a/shared/tunnelbroker-client/src/lib.rs
+++ b/shared/tunnelbroker-client/src/lib.rs
@@ -1,6 +1,8 @@
+use anyhow::Result;
use lazy_static::lazy_static;
use std::sync::Arc;
use tokio::runtime::{Builder, Runtime};
+use tokio::sync::mpsc;
use tonic::transport::Channel;
pub mod tunnelbroker_pb {
@@ -24,3 +26,18 @@
.block_on(TunnelbrokerServiceClient::connect(addr))
.expect("Failed to connect to the Tunnelbroker Service")
}
+
+pub async fn publish_messages(
+ tx: &mpsc::Sender<tunnelbroker_pb::MessageToTunnelbroker>,
+ messages: Vec<tunnelbroker_pb::MessageToTunnelbrokerStruct>,
+) -> Result<()> {
+ let messages = tunnelbroker_pb::MessageToTunnelbroker {
+ data: Some(
+ tunnelbroker_pb::message_to_tunnelbroker::Data::MessagesToSend(
+ tunnelbroker_pb::MessagesToSend { messages },
+ ),
+ ),
+ };
+ tx.send(messages).await?;
+ Ok(())
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 4:25 AM (21 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2675267
Default Alt Text
D6284.diff (983 B)
Attached To
Mode
D6284: [tunnelbroker-client] Adding `publish_message` client function
Attached
Detach File
Event Timeline
Log In to Comment