 
 
 (defn start-watching-futures!
+  "start watching futures registered with register-future!"
   []
   (periodically 250 watch-futures))

  (.scheduleWithFixedDelay scheduled-executor ^Runnable f 0 n TimeUnit/MILLISECONDS))


(def future-map (atom {}))


(defn register-future!
  [a-future on-error on-exit]
  (swap! future-map assoc a-future {:on-error on-error :on-exit on-exit}))




(defn- mark-watcher-alive
  "print a log message each minute, so we know the reaper is still
 alive"
  []
  (swap! call-counter inc)
  (when (zero? (rem @call-counter 240))
