 ;; Read config
 
 ;;https://github.com/l1x/shovel/blob/master/src/shovel/core.clj
+;;this is considered defensing programming, but it is intentional
+;;supplying an arbitrary bad input should not cause this function to 
+;;explode, in fact it should just return an error
 (defn read-file
   "Returns {:ok string } or {:error...}"
   [^String file]


;This function wraps the read-file and the parse-edn-string
;so that it only return {:ok ... } or {:error ...} 
(defn read-config 
  [file]
  (let 
    [ file-string (read-file file) ]

      (blocking-consumer
        (go
          (let [[result source] (alts! [chan (timeout 1500)])]
            ;; if source is the channel than a value is returned in result
            ;; when the source is something else like timeout, we time out
            ;; and stop execution
            ;; production timeout should be like 1-3 mins
            (if (= source chan)
              (println "Got a value!" result)
              ;else - timeout 
