Zach Klippenstein (he/him) [MOD]
09/06/2019, 6:26 PMcallbackFlow
and channelFlow
(e.g. https://github.com/Kotlin/kotlinx.coroutines/issues/1500).
The rationale for having two separate aliases for the same function is that “have different names to tailor their docs the the speicific use-case and to enable the code using them to convey your intention.”
Is the distinction between them really providing enough value to justify all the confusion they seem to be creating? It seems like the documentation could be merged, and I don’t fully understand how much value is really added by making “intent” clearer – in what case would choosing one over the other actually make code significantly clearer? If callbacks are being used, it will be apparent in the code because there’ll be lambdas and addListener
calls everywhere. Additionally, RxJava users have gotten used to using Observable.create { }
for integrating with callback-based APIs even though it doesn’t have “callback” in the name anywhere.Pablichjenkov
09/07/2019, 1:23 AMZach Klippenstein (he/him) [MOD]
09/07/2019, 2:03 AMcallbackFlow
seems too focused on a particular use casePablichjenkov
09/07/2019, 9:36 PM