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
Current implement of put_if_not_exists() only return bool indicate succeed or not, I think it's make more useful to return revision of key, for example, after put_if_not_exits(KEY), user add watch of KEY to monitor if it's been delete or not. without revision, it always has the chance that the next watch call didn't catch all event since PUT, unless use revision as parameter.
with revision, a better user code can be write as
status,revision = put_if_not_exists(client,KEY,VALUE)
# delay can happen between two calls
client.add_watch_callback(TEST_KEY,watch_cb,start_revision=revision+1)
I tried to write my own impl, but it end with unwrap RPC message layers, (resp.response_put.header.revision) not quite good.
Current implement of put_if_not_exists() only return bool indicate succeed or not, I think it's make more useful to return revision of key, for example, after put_if_not_exits(KEY), user add watch of KEY to monitor if it's been delete or not. without revision, it always has the chance that the next watch call didn't catch all event since PUT, unless use revision as parameter.
with revision, a better user code can be write as
I tried to write my own impl, but it end with unwrap RPC message layers, (resp.response_put.header.revision) not quite good.
The text was updated successfully, but these errors were encountered: