BleScanCoroutines
BleScanCoroutines copied to clipboard
Using `flow` vs `channel` for scan results
Hi Louis,
The scanChannel extension function currently returns a Channel. Do you think a Flow might be more suitable here?
I'm new to channels/flows/coroutines, so my understanding may not be correct. A Flow would allow more flexibility in when scanning should actually start - e.g. only after the user calls collect.
Current API works fine for my needs, but I was curious about your thoughts.
Thanks.
Hi Gautam, yes, a Flow should work too, using flowViaChannel. Did you try it in your code with devices to scan?