Hey folks,

Can someone sanity check this for me, please?

I want to write some code that processes messages on a core.async channel, 
at a rate of *at most* 1 message per second. I'm using this code:

(go
  (while true
    (let [t (timeout 1000)]
      (log "Message is: " (<! my-interesting-channel))
      (<! t))))

I'm expecting the timeout channel to start ticking down at the top. We 
process one message, and then iff that took less than 1s, the timeout 
channel will parse for the remaining milliseconds.

It seems right to me, but I'd appreciate a second look, if someone can 
spare the time. :-)

Cheers,
Kris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to