raboof commented on issue #2178: URL: https://github.com/apache/pekko/issues/2178#issuecomment-3266306568
> > > The entire pekko-stream codebase is all designed with the assumption that `null` is never going to be any element > > > > > > As far as I understand, the operator proposed in the issue would indeed not have `null` as an element, but use it as a marker to indicate the 'partial' function does produce a result to be put on the stream for the current input. > > That might be the case, but it would be an anomaly as in all other places with pekko streams, even if we are not dealing with an element in a stream, `Optional.empty` is used to represent an absent value and not `null` (i.e. partition/collect/filter like operators) Partition and filter don't use Optional. I agree we should not have both the current 'collect' _and_ new method that uses null instead. > And I believe that the reason behind this is deliberate, such a design is really meant to hone in "don't use null" when working with pekko streams and having some exception methods that work with `null` in some way just confuses users. That's possible, but changing this in 2.x Java API should at least be on the table to discuss. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org