rpc Lock (LockRequest) returns (LockResponse) { }
rpc Unlock (UnlockRequest) returns (UnlockResponse) { }
message LockRequest {
bytes name = 1;
int64 lease = 2;
}
message LockResponse {
ResponseHeader header = 1;
bytes key = 2;
}
message UnlockRequest {
bytes key = 1;
}
message UnlockResponse {
ResponseHeader header = 1;
}
lock name creates key name/uuid
lock key must be checked in exclusive operations to ensure consistency