-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added distributed lock API #159
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Zachary Edgell <[email protected]>
Signed-off-by: Zachary Edgell <[email protected]>
Signed-off-by: Zachary Edgell <[email protected]>
Signed-off-by: Zachary Edgell <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, some minor suggestions
/// Distributed lock request call | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `request` - Request to be made, TryLockRequest | ||
pub async fn lock(&mut self, request: TryLockRequest) -> Result<TryLockResponse, Error> { | ||
self.0.lock(request).await | ||
} | ||
|
||
/// Distributed lock request call | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `request` - Request to be made, TryLockRequest | ||
pub async fn unlock(&mut self, request: UnlockRequest) -> Result<UnlockResponse, Error> { | ||
self.0.unlock(request).await | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be beneficial to have examples here in the doc comments of building and using the api call e.g.
/// # Example
///
/// ```
/// let result = client
/// .try_lock(dapr::client::TryLockRequest {
/// store_name: "lockstore".to_string(),
/// resource_id: "resource".to_string(),
/// lock_owner: "owner".to_string(),
/// expiry_in_seconds: 60,
/// })
/// .await
/// .unwrap();
/// ```
Signed-off-by: Mike Nguyen <[email protected]>
Signed-off-by: mikeee <[email protected]>
Signed-off-by: Mike Nguyen <[email protected]>
Signed-off-by: Mike Nguyen <[email protected]>
Co-authored-by: Mike Nguyen <[email protected]> Signed-off-by: Zachary K Edgell <[email protected]>
Co-authored-by: Mike Nguyen <[email protected]> Signed-off-by: Zachary K Edgell <[email protected]>
Co-authored-by: Mike Nguyen <[email protected]> Signed-off-by: Zachary K Edgell <[email protected]>
Signed-off-by: Mike Nguyen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can create another issue to track adding documentation but before a final review the APIs need to be defined in the interface -> https://github.com/dapr/rust-sdk/pull/159/files#diff-7f93c4e263c4e9ec748f804c7fd04a3b2fde86ffd741fb5516d67e1097bae4c1L545
This pull request has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Description
Added distributed lock API
Issue reference
This PR will close #86
Checklist