   []
   (let [{:keys [advance add-waiter]} (fake-clock)
         timeout (fn [^long ms]
-                  (let [c (chan)]
-                    (add-waiter ms false (fn [] (close! c)))
+                  (let [c (async/chan)]
+                    (add-waiter ms false #(async/close! c))
                     c))]
     [advance {#'clojure.core.async/timeout timeout}]))
 

                    [advance redefs] (fake-timeout)]
                (with-redefs-fn redefs
                  (fn []
                    (let [c (execute step)]
                      (assert (still-open?) "before adding callback")
                      (take! c (fn [_] (reset! state false)))
                      (assert (still-open?) "after adding callback")
                      (advance 5)
                      (assert (still-open?) "before trigger")

(ns icecap.handlers.delay-test
  (:require [schema.core :as s]
            [icecap.handlers.core :refer [execute get-schema]]
            [icecap.handlers.delay :as hd]
            [clojure.test :refer :all]
            [manifold.stream :as ms]
            [manifold.deferred :as md]
            [clojure.core.async :as async])
  (:import (java.lang Thread)))

(defn fake-clock
