Permalink
Browse files

use dorun when only need side effect

  • Loading branch information...
1 parent 35ad23a commit 400342f57c6a1dbbb2e997e22ee8ff215905931b @xiaonaitong xiaonaitong committed Sep 28, 2011
Showing with 5 additions and 5 deletions.
  1. +2 −2 scripts/bench.clj
  2. +1 −1 scripts/put.clj
  3. +1 −1 src/clojalk/core.clj
  4. +1 −1 src/clojalk/wal.clj
View
4 scripts/bench.clj
@@ -70,8 +70,8 @@
(.setDaemon t false)
(.start t)))
-(doall (map run-in-thread (take 5 (repeat producer))))
-(doall (map run-in-thread (take 10 (repeat worker))))
+(dorun (map run-in-thread (take 5 (repeat producer))))
+(dorun (map run-in-thread (take 10 (repeat worker))))
(run-in-thread monitor)
(println "benchmark started")
View
2 scripts/put.clj
@@ -41,6 +41,6 @@
(time
(do
- (doall (map run-in-thread (take total-clients (repeat do-put-jobs))))
+ (dorun (map run-in-thread (take total-clients (repeat do-put-jobs))))
(.await latch)))
View
2 src/clojalk/core.clj
@@ -157,7 +157,7 @@
(let [session (@sessions id)]
(dosync
(dequeue-waiting-session session)
- (doall (map #(set-job-as-ready (@jobs %)) (:reserved_jobs @session)))
+ (dorun (map #(set-job-as-ready (@jobs %)) (:reserved_jobs @session)))
(alter sessions dissoc id))))
;; ## Macros for convenience of creating and executing commands
View
2 src/clojalk/wal.clj
@@ -213,7 +213,7 @@
(if-let [bin-log-files (scan-dir *clojalk-log-dir*)]
(do
(dosync
- (doall (map #(read-file % replay-handler) bin-log-files))
+ (dorun (map #(read-file % replay-handler) bin-log-files))
(replay-tubes))
(println (str (count @clojalk.data/jobs) " jobs loaded from write-ahead logs."))
(update-id-counter)))

0 comments on commit 400342f

Please sign in to comment.