 (defonce talaria-state (ref {:connections {}
                              :stats {}}))
 
+(declare clear-closed)
+
 (defn init [& {:keys [ws-delay ajax-delay ping-ms]
                :or {ws-delay 30
                     ajax-delay 150

  (let [close-fn (ws-close-handler talaria-state)]
    (doseq [ch (remove ajax-channel? (closed-channels))]
      (close-fn ch {}))))

                                    :ws-delay ws-delay
                                    :ajax-delay ajax-delay
                                    :ping-ms ping-ms
                                    :stats {}}))
    (delay/repeat-fn async-pool (* 1000 60 5) clear-closed))
  talaria-state)

(defn shutdown [tal-state]
