Permalink
Browse files

debug

  • Loading branch information...
1 parent 641fc08 commit f5f43cbf9f90dffb8c5f362bca879ee1112eac74 @mmcgrana mmcgrana committed Apr 30, 2012
Showing with 26 additions and 0 deletions.
  1. +1 −0 Procfile
  2. +25 −0 src/pulse/debugger.clj
View
1 Procfile
@@ -6,3 +6,4 @@ merger2: lein trampoline run -m pulse.merger 2
merger3: lein trampoline run -m pulse.merger 3
merger4: lein trampoline run -m pulse.merger 4
emitter: lein trampoline run -m pulse.emitter
+debugger: lein trampoline run -m pulse.debugger
View
25 src/pulse/debugger.clj
@@ -0,0 +1,25 @@
+(ns pulse.debugger
+ (:require [pulse.conf :as conf]
+ [pulse.log :as log]
+ [pulse.util :as util]
+ [pulse.queue :as queue]
+ [pulse.io :as io]))
+
+(defn log [& data]
+ (apply log/log :ns "debugger" data))
+
+
+(defn init-debugger [debug-queue]
+ (log :fn "init-debugger" :at "start")
+ (util/spawn-loop (fn []
+ (let [line (queue/take debug-queue)]
+ (locking *out*
+ (prn line))))))
+
+(defn -main []
+ (log :fn "main" :at "start")
+ (let [debug-queue (queue/init 10000)]
+ (queue/init-watcher debug-queue "debug")
+ (init-debugger debug-queue)
+ (io/init-bleeders (conf/aorta-urls) debug-queue)
+ (log :fn "main" :at "finish")))

0 comments on commit f5f43cb

Please sign in to comment.