mdedetrich commented on issue #2178: URL: https://github.com/apache/pekko/issues/2178#issuecomment-3266246993
> It's possible, the `null` will just be ignored for some operator, and trigger another `pull(in)` if the upstream is not completed and not been pulled yet. just as the `mapAsync` operator, where when you return a `CompletionStage<T>` but the value is null, then the `null` is just dropped and trigger another `pull(in)`, you can check the scaladoc of mapAsync. > > I think we can have a special operator, which just drop the `null` value, when working with Java 21 's patten matching, it works like a charm The entire pekko-stream codebase is all designed with the assumption that `null` is never going to be any element. This is not something thats easy to change, and I personally wouldn't accept such an operator until pekko streams in general works with `null` elements, which could be something for 2.0.0 but this is a massive change There are way too many edge cases and surprising behaviour otherwise, and I have personally spent days/weeks debugging streams due to a single stranded `null` element being sent somewhere. The way that `null` behaves also differs completely depending on which streaming operator. Illegal means illegal, the entire codebase is based on the assumption that it should never exist. -- 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