This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-18
Channels
- # bangalore-clj (1)
- # beginners (36)
- # boot (119)
- # braid-chat (16)
- # cider (14)
- # cljs-dev (34)
- # cljsrn (7)
- # clojars (9)
- # clojure (91)
- # clojure-austin (1)
- # clojure-bangladesh (1)
- # clojure-dusseldorf (5)
- # clojure-israel (1)
- # clojure-russia (3)
- # clojure-spec (6)
- # clojure-uk (7)
- # clojurescript (11)
- # community-development (1)
- # core-async (5)
- # cursive (6)
- # datomic (11)
- # dirac (12)
- # funcool (24)
- # leiningen (5)
- # luminus (5)
- # off-topic (2)
- # om (69)
- # om-next (16)
- # overtone (4)
- # perun (19)
- # re-frame (23)
- # reagent (38)
- # specter (7)
- # uncomplicate (9)
- # yada (4)
an expanding transducer is allowed to put more things in a fixed buffer than the buffer size (otherwise there would be no place else to put them)
if you want more laziness than that, use the transducer in a process and put to the channel, rather than putting it in the channel itself
alexmiller: Thanks for answering, Alex. I'm aware of that, but this is different. I'm OK with a buffer growing slightly overboard if the transducer returned a bigger collection; but because of this bug the size of the buffer can grow infinitely even though the transcducer returns small chunks
I filed a bug report for this http://dev.clojure.org/jira/browse/ASYNC-178, there is also a SO question addressing the same thing http://stackoverflow.com/questions/37953401/where-is-the-memory-leak-when-mapcat-breaks-backpressure-in-core-async
I believe, not checking for buffer fullness before applying the first pending put!
is an optimization/assumption from a pre-transducer era. The code assumes that since a take!
was just executed, there is a room for a pending put!
to apply; but that might not be the case with expanding transducers — the buffer might still be full from the previous put
.