Chachako06/23/2022, 9:39 AM
will resume? If there is a task in the
block that doesn’t know when it will complete, when will the coroutines channel close? I’m a little curious what the criteria is for the channel to determine
completion, is it to wait a while without any
and then end the hang?
Sam06/23/2022, 9:40 AM
Chachako06/23/2022, 9:52 AM
resume works hahaha
Sam06/23/2022, 9:55 AM
, the flow will terminate as soon as the code inside the builder is done executing. With
, it will run forever, until you explicitly stop collecting it. If you want anything different from those two options, you would need to implement it manually by calling
on the channel inside the builder.
Chachako06/23/2022, 9:58 AM
Sam06/23/2022, 9:58 AM
just registers a callback that will be invoked "as each element is required", so it's likely that the flow would complete immediately, before the callback has been invoked on any of the items.