if i want to implement an id generator with etcd, it seems that i need below operation in one transaction :
let t = etcd_client::new_txn();let old_id = t.get("id_key");let new_id = old_id + 1;t.set("id_key", new_id);t.commit();
or using CAS(compare and swap operation). but i can not find proper method to impement in this project.
is there any suggestions? thanks
if i want to implement an id generator with etcd, it seems that i need below operation in one transaction :
let t = etcd_client::new_txn();
let old_id = t.get("id_key");
let new_id = old_id + 1;
t.set("id_key", new_id);
t.commit();
or using CAS(compare and swap operation). but i can not find proper method to impement in this project. is there any suggestions? thanks