On Thu, 9 Nov 2023 09:39:33 GMT, Tagir F. Valeev <tval...@openjdk.org> wrote:

>> Ah, now I see what you mean. In this specific case you might be able to 
>> create a combiner (which would also need a Downstream) such that you can add 
>> the missing combinations (the end of the "left" and the beginning of the 
>> "right"). But imagine something like `windowFixed(3)`, where the presence of 
>> 1 or 2 elements to the "left" will skew all the elements to the "right", 
>> potentially rippling through the entire stream.
>> 
>> I think the Preview is a perfect place to see if the combiner would be made 
>> even better with a Downstream reference or not. Logically, the output of 
>> said Downstream would be placed *after* the "left"'s output, and *before* 
>> the "right"'s output (so in the middle of the two).
>> 
>> But then someone might want to be able to inject elements outside of that 
>> order, but I guess that remains to be seen.
>> 
>> Great thoughts, @amaembo 👍
>
> With windowFixed, true parallelization is not possible, unless the stream is 
> SIZED/SUBSIZED, but this information is not available for Gatherer, so we 
> cannot solve this at all (and this is probably a reasonable limitation of the 
> API).
> 
>> But then someone might want to be able to inject elements outside of that 
>> order, but I guess that remains to be seen.
> 
> Not sure where one may want to inject other elements. If you want to add 
> something after the right output, you can do this inside the finisher, or the 
> next combiner, when the "right" will become the "left". There are no other 
> places to insert. E.g., you cannot insert "before left", because downstream 
> collector has no corresponding operation. To me it looks like inserting after 
> the "left" part is the only possibility.

@amaembo Alright, then I think we are aligned. Experimentation with 
combiner-downstream should be possible during the Preview-cycle

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1387776261

Reply via email to