 
 (defn on-server-sync
   "Registers the handler to be executed when all the osc messages generated
-   by executing the action-fn have completed."
+   by executing the action-fn have completed. Returns result of action-fn."
   [action-fn handler-fn]
   (let [id (update-server-sync-id)]
     (on-event "/synced" (uuid)

                         (do
                           (handler-fn)
                           :done))))
    (action-fn)
    (snd "/sync" id)))

(defn with-server-sync
  "Blocks current thread until all osc messages in action-fn have completed"
  [action-fn]
  (let [id (update-server-sync-id)
        prom (promise)]

                         (do
                           (deliver prom true)
                           :done))))
    (let [res (action-fn)]
      (snd "/sync" id)
      (await-promise! prom)
      res)))


(defn stop
