项目作者: dragonball-clap

项目描述 :
ZooKeeper client written in pure Rust for humans
高级语言: Rust
项目地址: git://github.com/dragonball-clap/buruma.git
创建时间: 2020-12-03T10:04:53Z
项目社区:https://github.com/dragonball-clap/buruma

开源协议:GNU General Public License v3.0

下载


buruma

使用 Rust 基于 tokio 编写的 ZooKeeper 高性能异步客户端。

女神

Basic Usage

引入依赖,在 Cargo.toml

  1. repeekooz = "0.1.0"
  1. use repeekooz::{ACL, CreateMode, ZooKeeper};
  2. // create client
  3. let mut zk = ZooKeeper::new("127.0.0.1:2181", Duration::from_secs(5)).await?;
  4. // create node
  5. zk.create("/your/path", Some("I love buruma".as_bytes()), ACL::world_acl(), CreateMode::Persistent).await?;
  6. // get data
  7. let data = zk.get("/your/path", None).await?;
  8. // set data
  9. let stat = zk.set("/your/path", "buruma NB".as_bytes()).await?;
  10. // delete node
  11. zk.delete("/your/path").await?;