Hi! What would you use to communicate between in A...
# coroutines
Hi! What would you use to communicate between in Android example
. Point is that in viewmodel I can't create worker and vise versa, so they can't communicate directly. Here ViewModel is producing hls chunks (ts files) and worker would upload them when new is created. I can make one
object Repo
which would connect both pieces but I don't know what to use inside, Channels, Flow? In worker I have one suspend function which need to be blocked while not everything is uploaded. Would be glad if someone could help me with that ☺️ Thanks!
I’ve never actually used work manager, but from what I understand you’ll want to persist it to a db. Your app and an instance of work manager are two separate processes so communicating between them can’t be done easily with normal constructs like a flow or channel.
Wow, nice, that's a great idea with database. Sometimes it's a must to think out of the box :) Thanks
The run in the same process, unless you use the work-multiprocess artifact. Since they are in the same process, you can have some in memory repo also that communicates with a channel. But i agree the dB makes it easy.