Closed DerGuteMoritz closed 8 years ago
Thanks for the report, I'll look into it.
This happens because the transducer is piped into manifold.stream.default/add!
. In an "expanding" transducer this means add!
will get called multiple times while only the last result of add!
gets used in Stream.put
.
Yeah, that's definitely the problem. Sorry this fell off my radar so completely, I'm trying to figure out a reasonable way to fix this now.
I have a fix for this, which adds about 10% overhead relative to the previous implementation, since we have to allocate an accumulator for the result. I should probably split out the transducer and non-transducer implementations, so we only have this overhead in the former case, but for now everything seems to work, at least.
When a transducer which may call the step function more than once (expanding transducer?) is attached to a source,
consume
callbacks seem to not be called anymore. For example,mapcat
gives us such a transducer and it has the following effect: