mdedetrich commented on PR #2422: URL: https://github.com/apache/pekko/pull/2422#issuecomment-3479174760
> @mdedetrich The problem is that when there is only one element, `Source.apply(Array(1))` and `Source.apply(1)` have the same meaning. However, `Source.apply(Array(1), Array(1))` means two `Array(1)` objects, while `Source.apply(Array(1))` does not represent a single `Array`, which is simply incomprehensible. I think we should follow the original design. For starters, doing `Source(Array(1),Array(1))` seems a bit off because wanting to send entire mutable arrays is almost never what the user wants, rather they almost always want the elements in those arrays. I agree it's not consistent but its only for one definition of consistent. We can care about consistency of the precise args being sent in (in which case you are right) but there is also consistency regarding what you want in an `Source`, and 99% of the time if someone is constructing a Source from a collection what they want to do is to have all of the elements in that collection to be individual emitted elements in that `Source` The real question then though, is what are we solving if we have a `Source.elements` method then? The only reason to have these kinds of methods is to save some keystrokes, and if you have `Source.elements(1,2,3)` you can just do `Source(List(1,2,3))` instead. -- 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]
