@@ -455,6 +455,24 @@ impl<T: DaprInterface> Client<T> {
455
455
. collect ( ) ;
456
456
self . 0 . decrypt ( requested_items) . await
457
457
}
458
+
459
+ /// Distributed lock request call
460
+ ///
461
+ /// # Arguments
462
+ ///
463
+ /// * `request` - Request to be made, TryLockRequest
464
+ pub async fn lock ( & mut self , request : TryLockRequest ) -> Result < TryLockResponse , Error > {
465
+ self . 0 . lock ( request) . await
466
+ }
467
+
468
+ /// Distributed lock request call
469
+ ///
470
+ /// # Arguments
471
+ ///
472
+ /// * `request` - Request to be made, TryLockRequest
473
+ pub async fn unlock ( & mut self , request : UnlockRequest ) -> Result < UnlockResponse , Error > {
474
+ self . 0 . unlock ( request) . await
475
+ }
458
476
}
459
477
460
478
#[ async_trait]
@@ -501,6 +519,10 @@ pub trait DaprInterface: Sized {
501
519
-> Result < Vec < StreamPayload > , Status > ;
502
520
503
521
async fn decrypt ( & mut self , payload : Vec < DecryptRequest > ) -> Result < Vec < u8 > , Status > ;
522
+
523
+ async fn lock ( & mut self , request : TryLockRequest ) -> Result < TryLockResponse , Error > ;
524
+
525
+ async fn unlock ( & mut self , request : UnlockRequest ) -> Result < UnlockResponse , Error > ;
504
526
}
505
527
506
528
#[ async_trait]
@@ -661,6 +683,24 @@ impl DaprInterface for dapr_v1::dapr_client::DaprClient<TonicChannel> {
661
683
}
662
684
Ok ( data)
663
685
}
686
+
687
+ /// Distributed lock request call
688
+ ///
689
+ /// # Arguments
690
+ ///
691
+ /// * `request` - Request to be made, TryLockRequest
692
+ async fn lock ( & mut self , request : TryLockRequest ) -> Result < TryLockResponse , Error > {
693
+ Ok ( self . try_lock_alpha1 ( request) . await ?. into_inner ( ) )
694
+ }
695
+
696
+ /// Distributed unlock request call
697
+ ///
698
+ /// # Arguments
699
+ ///
700
+ /// * `request` - Request to be made, UnlockRequest
701
+ async fn unlock ( & mut self , request : UnlockRequest ) -> Result < UnlockResponse , Error > {
702
+ Ok ( self . unlock_alpha1 ( request) . await ?. into_inner ( ) )
703
+ }
664
704
}
665
705
666
706
/// A request from invoking a service
@@ -752,6 +792,18 @@ pub type EncryptRequestOptions = crate::dapr::dapr::proto::runtime::v1::EncryptR
752
792
/// Decryption request options
753
793
pub type DecryptRequestOptions = crate :: dapr:: dapr:: proto:: runtime:: v1:: DecryptRequestOptions ;
754
794
795
+ /// Lock response
796
+ pub type TryLockResponse = crate :: dapr:: dapr:: proto:: runtime:: v1:: TryLockResponse ;
797
+
798
+ /// Lock request
799
+ pub type TryLockRequest = crate :: dapr:: dapr:: proto:: runtime:: v1:: TryLockRequest ;
800
+
801
+ /// Unlock request
802
+ pub type UnlockRequest = crate :: dapr:: dapr:: proto:: runtime:: v1:: UnlockRequest ;
803
+
804
+ /// Unlock response
805
+ pub type UnlockResponse = crate :: dapr:: dapr:: proto:: runtime:: v1:: UnlockResponse ;
806
+
755
807
type StreamPayload = crate :: dapr:: dapr:: proto:: common:: v1:: StreamPayload ;
756
808
impl < K > From < ( K , Vec < u8 > ) > for common_v1:: StateItem
757
809
where
0 commit comments