File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 99 auth:: ed25519_dalek:: Keypair ,
1010 domain:: { DecodedClientId , SubscriptionId , Topic } ,
1111 jwt:: { self , JwtError , VerifyableClaims } ,
12- rpc:: { self , RequestPayload } ,
12+ rpc:: { self , Receipt , RequestPayload } ,
1313 } ,
1414 std:: { sync:: Arc , time:: Duration } ,
1515 url:: Url ,
@@ -247,6 +247,17 @@ impl Client {
247247 . await
248248 }
249249
250+ /// Acknowledge receipt of messages from a subscribed client.
251+ pub async fn batch_receive (
252+ & self ,
253+ receipts : impl Into < Vec < Receipt > > ,
254+ ) -> Response < rpc:: BatchReceiveMessages > {
255+ self . request ( rpc:: BatchReceiveMessages {
256+ receipts : receipts. into ( ) ,
257+ } )
258+ . await
259+ }
260+
250261 pub ( crate ) async fn request < T > ( & self , payload : T ) -> Response < T >
251262 where
252263 T : RequestPayload ,
Original file line number Diff line number Diff line change 55 domain:: { SubscriptionId , Topic } ,
66 rpc:: {
77 BatchFetchMessages ,
8+ BatchReceiveMessages ,
89 BatchSubscribe ,
910 BatchUnsubscribe ,
1011 FetchMessages ,
1112 Publish ,
13+ Receipt ,
1214 Subscribe ,
1315 Subscription ,
1416 Unsubscribe ,
@@ -231,6 +233,20 @@ impl Client {
231233 response
232234 }
233235
236+ /// Acknowledge receipt of messages from a subscribed client.
237+ pub async fn batch_receive (
238+ & self ,
239+ receipts : impl Into < Vec < Receipt > > ,
240+ ) -> ResponseFuture < BatchReceiveMessages > {
241+ let ( request, response) = create_request ( BatchReceiveMessages {
242+ receipts : receipts. into ( ) ,
243+ } ) ;
244+
245+ self . request ( request) ;
246+
247+ response
248+ }
249+
234250 /// Opens a connection to the Relay.
235251 pub async fn connect ( & self , opts : & ConnectionOptions ) -> Result < ( ) , Error > {
236252 let ( tx, rx) = oneshot:: channel ( ) ;
You can’t perform that action at this time.
0 commit comments