mdedetrich commented on issue #2178: URL: https://github.com/apache/pekko/issues/2178#issuecomment-3266326850
> Partition and filter don't use Optional. I agree we should not have both the current 'collect' _and_ new method that uses null instead. I don't remember the exact methods on hand but https://pekko.apache.org/docs/pekko/1.1/stream/operators/RetryFlow/withBackoff.html is an example of what I mean. I don't ever remember a single instance of `null` ever being used to represent an absence of value in pekko streams, its always `Optional.empty` > > 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. Yes, but is a big change and so such we should be quite deliberate and careful whether we do this. Personally and for the reasons I stated, I am already on the no side of the fence. Yes its annoying that you have to convert between null and `Optional` but it really makes it clear that when in pekko/akka/reactive streams land, just don't use `null`. -- 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