> > This brings up another issue: Currently writing to a closed channel is a > no-op, but it probably should throw an exception. Similarly, closing a > closed channel is a no-op, but also probably should throw an exception. > Both are things that a well behaved sender should never do, since they know > when they close, so they know not to keep putting stuff in there. Or, they > are warned of the impending close by some coordination process & the same > rules apply. >
Sorry to resurrect an old thread, but why not return true on successful put, false otherwise? That would allow for the following: (loop [] (let [results (get-metrics metrics)] (when (async/>! mchan results) (recur)))) You could terminate blocks simply by closing the channel. You also avoid the messy higher order (quit) channel. -- -- 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.