From 6419afba9a73a2cca9cb0976f039bbf2964df504 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Tue, 2 Sep 2025 09:43:56 +0200 Subject: [PATCH 1/2] Add new syntax candy fn to send a stream of updates to the server without any return message. Basically a streaming version of notify. --- src/lib.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 8d0ad3c..b87a3c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1454,6 +1454,37 @@ impl Client { } } + pub fn notify_streaming( + &self, + msg: Req, + local_update_cap: usize, + ) -> impl Future>> + where + S: From, + S::Message: From>, + Req: Channels>, + Update: RpcMessage, + { + let client = self.clone(); + async move { + let request = client.request().await?; + match request { + Request::Local(request) => { + let (req_tx, req_rx) = mpsc::channel(local_update_cap); + request.send((msg, NoSender, req_rx)).await?; + Ok(req_tx) + } + #[cfg(not(feature = "rpc"))] + Request::Remote(_request) => unreachable!(), + #[cfg(feature = "rpc")] + Request::Remote(remote) => { + let (s, _) = remote.write(msg).await?; + Ok(s.into()) + } + } + } + } + /// Performs a request for which the client can send updates, and the server returns a mpsc receiver. pub fn bidi_streaming( &self, From 54569075588aab295dfe67f7cbd80a4d2b3954ba Mon Sep 17 00:00:00 2001 From: Frando Date: Tue, 21 Oct 2025 15:41:50 +0200 Subject: [PATCH 2/2] add docs --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index b87a3c2..4edac0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1454,6 +1454,7 @@ impl Client { } } + /// Performs a request for which the client can send updates but does not receive a reply from the server. pub fn notify_streaming( &self, msg: Req,