Hi,

I’m wondering if there is a core.async design idiom for this situation...

- A buffered channel 
- One producer feeding it 
- A bunch of consumers pulling from it.
- Producer should wake up and fill the channel only when it’s empty. In 
other words, the producer should work in chunks.

My first idea is to have two channels. The second will be used by consumers 
to signal the producer that the primary channel is empty. But I'm wondering 
if there is a better way.

The motive for this is that the producer is doing a DB query that is more 
efficient in bulk. `select ... limit 50` rather than `select ... limit 1` 
50 times.

Rob

-- 
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/d/optout.

Reply via email to