            [org.json JSONObject JSONArray]
            [java.util Date UUID]
            [java.text SimpleDateFormat]
-           [ij ImagePlus]
-           )
+           [ij ImagePlus])
    (:gen-class
      :name org.micromanager.AcqEngine
      :implements [org.micromanager.api.Pipeline]

  (while (and (:pause @state) (not (:stop @state))) (Thread/sleep 5)))

(defn interruptible-sleep [time-ms]
  (let [sleepy (CountDownLatch. 1)]
    (state-assoc! :sleepy sleepy :next-wake-time (+ (clock-ms) time-ms))
    (.await sleepy time-ms TimeUnit/MILLISECONDS)))

    (def last-state state)
    (let [acq-seq (generate-acq-sequence settings)]
       (def acq-sequence acq-seq)
       (execute (mapcat #(make-event-fns % out-queue) acq-seq))
       (.put out-queue TaggedImageQueue/POISON)
       (cleanup))))
