(def conn-chan (ev/thread-chan 1000))
(defn producer [no]
(forever
(ev/sleep 5)
(print "Adding data from producer num:" no)
(ev/give conn-chan (math/random))))
(defn consumer [no]
(forever
(ev/sleep 0.5)
(def num (ev/take conn-chan))
(print num ": Printing from consumer:" no)))
(defn main [& args]
(ev/spawn-thread (producer 1))
(ev/spawn-thread (consumer 1))
(ev/spawn-thread (consumer 2))
(ev/sleep 20)
(print "exiting"))