use std::collections::HashMap; use std::env; use std::sync::Arc; use std::time::Duration; use zookeeper; use jotty; struct NoopWatcher; impl zookeeper::Watcher for NoopWatcher { fn handle(&self, _ev: zookeeper::WatchedEvent) {} } fn zk_server_urls() -> String { let key = "ZOOKEEPER_SERVERS"; match env::var(key) { Ok(val) => val, Err(_) => "localhost:2181".to_string(), } } fn main() { // env_logger::init(); // // let zk_urls = zk_server_urls(); // // let zk = // zookeeper::ZooKeeper::connect(&*zk_urls, Duration::from_millis(2500), NoopWatcher).unwrap(); // let zka = Arc::new(zk); // // let client = jotty::client::Client::new(zka.clone(), "co.volf.nomadic", None); // // // namespace, method, arguments, resources, execution configuration // let task = client.add_task("runvm", serde_json::Value::Null, HashMap::new()); // // println!("{:?}", task); }