Typo — I meant to say the channel executes puts during a take! even though the 
buffer is full before executing the puts. This is clearer in code (please see 
the gist).

> On Jan 6, 2018, at 11:55 AM, Brian J. Rubinton <brianrubin...@gmail.com> 
> wrote:
> 
> Alex - it makes sense to me that the buffer temporarily expands beyond its 
> normal size with the content of the expanding transducer. What does not make 
> sense to me is the buffer also accepts puts even though its buffer is full.
> 
> Why would the take! process puts when the channel's buffer is full?
> 
> I was experimenting with the implementation and I think the patch in this 
> gist leads to more intuitive behavior — though it’s possible it breaks 
> something else. 
> https://gist.github.com/brianru/d30f0319e7a14d875a80762937cccb9c 
> <https://gist.github.com/brianru/d30f0319e7a14d875a80762937cccb9c>
> 
> 
> 
>> On Jan 6, 2018, at 11:43 AM, Alex Miller <a...@puredanger.com 
>> <mailto:a...@puredanger.com>> wrote:
>> 
>> 
>> 
>> On Saturday, January 6, 2018 at 10:27:20 AM UTC-6, Rob Nikander wrote:
>> 
>> On Jan 5, 2018, at 8:01 PM, Gary Verhaegen <gary.ve...@gmail.com <>> wrote:
>> What about simply having the producer put items one by one on the channel?
>> 
>> I will do that. My current producer is doing too many other things, but if I 
>> break it up into separate threads or go blocks for each work queue, then 
>> that should work. Thank you.
>>  
>> 
>> On Saturday, January 6, 2018 at 8:22:34 AM UTC-5, Brian J. Rubinton wrote:
>> I think the behavior in our examples differ because the blocking puts will 
>> complete whenever there is a take and the buffer is not full, ignoring 
>> whether the transducer is still outputting values. This bug may be relevant, 
>> though there it arises in a less common scenario (fixed buffer of size 0, 
>> which is now disallowed) https://dev.clojure.org/jira/browse/ASYNC-140 
>> <https://www.google.com/url?q=https%3A%2F%2Fdev.clojure.org%2Fjira%2Fbrowse%2FASYNC-140&sa=D&sntz=1&usg=AFQjCNE8iUd6leBDWTq5mesMFvpziQvA3w>
>> 
>> So, should I report this as a bug? If you have channel with a buffer and a 
>> (mapcat identity) transducer, the number of items in the channel can grow 
>> without bound. I thought channels were supposed to prevent that.
>> 
>> This is by design. Because the transducer executes in the channel, it's 
>> possible for it to temporarily expand the buffer beyond its normal size. 
>> This is certainly something to be aware of when using an expanding 
>> transducer (mapcat is probably the most common case).
>> 
>> -- 
>> 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 
>> <mailto: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 
>> <mailto:clojure+unsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en 
>> <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 
>> <mailto:clojure+unsubscr...@googlegroups.com>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 

-- 
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