bool register_keeper(lock_service& z, const std::string& ip, int port){ std::string path = JUBAKEEPER_BASE_PATH; z.create(path, ""); { std::string path1; build_existence_path(path, ip, port, path1); z.create(path1, "", true); } // set exit zlistener here pfi::lang::function <void()> f = &force_exit; z.push_cleanup(f); return true; }
// zk -> name -> ip -> port -> bool bool register_actor(lock_service& z, const std::string& name, const std::string& ip, int port){ std::string path = ACTOR_BASE_PATH + "/" + name; z.create(path, ""); z.create(path + "/master_lock", ""); path += "/nodes"; z.create(path , ""); { std::string path1; build_existence_path(path, ip, port, path1); z.create(path1, "", true); } // set exit zlistener here pfi::lang::function <void()> f = &force_exit; z.push_cleanup(f); return true; }
bool push_cleanup(lock_service& z, pfi::lang::function<void()>& f){ z.push_cleanup(f); return true; }