      [channels (keep #(% :from) (vals @started))]
      (let [[[message id args] ch] (alts! (conj channels (timeout 100)))]
        (case message
-         :line (println id " read " message " with args: " args)
+         :line (println "process " id " read " message " with args: " args)
          :exit (dosync (alter started dissoc id) (println id " exited"))
          nil)
        (recur (keep #(% :from) (vals @started)))))

       (fn [url options callback]
         (let [[command & args] (<!! command-chan)]
           (when args (println "command " command " the args were: " args))
           ;; (println "the url is " url " options " options " and the command " command)
           (Thread/sleep (options :timeout))
           (>!! request-chan (if args (apply conj [command] args) [command]))))]
      (call-http monitor-url request-chan response-chan))))

(defn -main

             :http-error [:http-error "whoops! http error!"]
             :exit (do (println "dieing!") [:quit])
             true [:http-error "whoops! that's not a signal we understand"])]
       (>! output (if response response []))) ; and send response so we recur http
     (recur (<! input)))
     
    ;; read the signals from the started processes
