He-Pin opened a new issue, #3130: URL: https://github.com/apache/pekko/issues/3130
### Motivation `Flow.groupBy` currently requires a positive `maxSubstreams` parameter, which limits the number of distinct keys that can be processed. If more distinct keys are encountered, the stream fails. This is problematic for use cases where the number of distinct keys is unknown or potentially unbounded (e.g., partitioning by user ID, session ID, or device ID). ### Proposed Enhancement Allow `maxSubstreams` to be set to `-1` (or any negative number) to indicate unlimited substreams. When set to unlimited: - No maximum substream count is enforced - The stream does not fail when encountering new keys - Memory usage scales with the number of active (non-completed) substreams This provides a simpler API for users who cannot predict the number of distinct keys upfront, compared to guessing a large upper bound. ### Impact - Simplifies usage of `groupBy` for unbounded key spaces - No breaking changes — existing positive values work as before - Memory management remains the user's responsibility (same as setting a very large `maxSubstreams`) ### References This enhancement was implemented in the Akka.NET project: https://github.com/akkadotnet/akka.net/issues/7607 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
