Marc Knaup08/09/2020, 1:49 PM
closes the Flow but
doesn’t close the Stream. Is that inconsistency intentional?
Dominaezzz08/09/2020, 6:21 PM
Marc Knaup08/09/2020, 6:30 PM
Dominaezzz08/09/2020, 6:37 PM
) it must be completely collected (or cancelled). With this rule, a
can hold on to resources once collection starts and release them upon completion/cancellation. Streams on the other hand, don't have to be completed after iteration begins, so the close method is used to signal a cancellation (I guess). Disclaimer: Haven't properly used Streams.
Marc Knaup08/09/2020, 6:38 PM
Dominaezzz08/09/2020, 6:45 PM
, I thought it was a special java function. Can you point me to the
function? I don't think it's the same function for both objects.
Marc Knaup08/09/2020, 6:46 PM
will close resources, in the other case it won’t. I think it’s a problem with Streams, but because they’re so similar and both coming from Kotlin, it’s still confusing.