     (when (.await latch conn-timeout TimeUnit/SECONDS)
       client)))
 
+(def valid-path?
+  (some-fn nil? #(.startsWith ^String % "/")))
+
 
 (defn init-queue!
   "Give queue-path and zookeeper-nodes.

   Returns queue object"
  [zk-queue-path & zk-nodes]
  {:pre [(every? :host zk-nodes)
         (seq zk-queue-path)]}
  (if-let [zk-client (zk-connect! zk-nodes)]
    (DistributedQueue. zk-client
                       zk-queue-path
                       nil)
    (throw (ex-info "Failed to Connect to zookeeper"
                    {:nodes zk-nodes}))))


(defn close!

(ns ^{:doc "A thin clojure wrapper over Zookeeper Queue Recipe"
      :author "Kiran Kulkarni <kk.questworld@gmail.com>"}
  com.helpshift.zk-queue
  (:refer-clojure :exclude [peek])
  (:require [clojure.string :as cs]
            [com.helpshift.zk-queue.utils :refer [to-byte-array]])
  (:import (org.apache.zookeeper ZooKeeper WatchedEvent Watcher)
