You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present, we are addressing issue #664 in PR #666. However, the current implementation is not very user-friendly, as users of the lock feature need to renew the lock lease manually.
For example,
// omit some code ...// grant a lease idlet lease_resp = lease_client
.grant(LeaseGrantRequest::new(DEFAULT_SESSION_TTL)).await?;let lock_lease_id = lease_resp.id;// do the lock operationlet req = build_request(matches).with_lease(lock_lease_id);let lock_resp = client.lock_client().lock(req).await?;
lock_resp.print();// renew the lock lease manually.let(keeper, stream) = client
.lease_client().keep_alive(LeaseKeepAliveRequest::new(lock_lease_id)).await?;
In fact, a better approach to achieve the same result is to have the lock method return a data structure, such as session or lock_scope. Within the lock method, a LockClient will grant a lease ID and store it in the session. This session will automatically renew the lease ID until it is dropped.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hi, @rohansx ! Due to the release plan, this issue will be closed after pr #820 is merged. Sorry about that. If you haven't started working on this issue yet, could you please consider picking up another one? We have other good-first-issues available. If you're interested, please feel free to claim one of them.
Description about the feature
At present, we are addressing issue #664 in PR #666. However, the current implementation is not very user-friendly, as users of the lock feature need to renew the lock lease manually.
For example,
In fact, a better approach to achieve the same result is to have the lock method return a data structure, such as session or lock_scope. Within the lock method, a LockClient will grant a lease ID and store it in the session. This session will automatically renew the lease ID until it is dropped.
Code of Conduct
The text was updated successfully, but these errors were encountered: