     (on path #(do (deliver p %) :done))
     p))
 
-(defn read-reply
+(defn await-promise
     "Read the reply received from the server, waiting for timeout ms if the message hasn't yet been received. Returns :timeout if a timeout occurs."
-    ([msg] (read-reply msg REPLY-TIMEOUT))
-    ([msg timeout]
+    ([prom] (await-promise msg REPLY-TIMEOUT))
+    ([prom timeout]
        (try
          (.get (future @msg) timeout TimeUnit/MILLISECONDS)
          (catch TimeoutException t
            :timeout))))
-
-(defn recv-and-wait
-  "Wait for a message associated with given path to be received from the server. If a timeout is specified then returns :timeout if no message has been received within timeout ms. Blocks current thread waiting for message"
-  [path & [timeout]]
-  (let [p (recv path)]
-    (if timeout
-      (read-reply p timeout)
-      @p)))
 
 (defn- parse-status [args]
   (let [[_ ugens synths groups loaded avg peak nominal actual] args]

(defn sync-all
  "Wait until all asynchronous server operations have been completed."
  []
  (recv-and-wait "/synced"))

; The /done message just has a single argument:
; "/done" "s" <completed-command>

   (let [ctls? (if (or (= 1 ctls?) (= true ctls?)) 1 0)]
     (let [reply-p (recv "/g_queryTree.reply")
           _ (snd "/g_queryTree" id ctls?)
          tree (:args (await-promise reply-p))]
       (with-meta (parse-node-tree tree)
         {:type ::node-tree})))))

