Closed wneirynck closed 3 years ago
After some more investigation, I've found that the issue also dissappears if I return r
instead of the future
on the last line of the 2-arity transducer function. The transducer specs do not really specify that this is the required behaviour, so that may be confusing.
So you can either just drop this issue, or make the Manifold code more robust to handle nil returns.
The transducer docs could be clearer, but yes, the 2-arity form is the main reduction and should always return the accumulated result so far. See the dedupe
, distinct
, and partition-by
transducers for similar examples.
In this case, failing to return the unchanged result only appears to be working because the output is totally independent of the accumulated result so far.
Given that this is an invalid transducer, I'm going to close the issue. FWIW, I can't replicate the bug on Manifold 0.1.9-alpha4 and Java 15, so hopefully it's not still a problem, regardless.
I have a stream that contains strings. These strings are actually multiline events, separated by empty lines. So I've created transducer that accumulates all values until it encounters an empty string, and then emits the accumated result before resetting:
The last line is required otherwise an exception occurs:
When using the transducer (without the
d/future
line) in a regular sequence, it works without problems.Example of failing code:`
This code works: