Luke Carpenter
10/29/2023, 10:29 PMFlow<List<LocalRecord>>
, instead of a List<LocalRecord>
, and if I try to collect
on the flow it blocks the worker.
Is this a good idea? If so, how do I retrieve the most up-to-date list of unsync’d `LocalRecord`’s from the flow, without blocking the worker? I’ve tried collectLatest
and last
, both of which don’t behave as expected.
If this isn’t a good idea, would it be better to spawn one worker for each record, at the risk of potentially overloading my server if a large number (200+) of records need syncing? I’ve gone through the nowinandroid implementation, and it’s doing some particularly fruity stuff with a DelegatingWorker
I don’t really understand 😵💫Chrimaeon
10/29/2023, 10:43 PMCoroutineWorker
to have a scope for your suspending calls.
https://developer.android.com/reference/kotlin/androidx/work/CoroutineWorkerLuke Carpenter
10/29/2023, 10:54 PMList<LocalRecord>
from my Room DAO then, instead of a Flow?List<LocalRecord>
and I was making my life harder for myself with the Flow
😅 😅 😅
Thank you Christian! 🙇