Hey, I want to use a background coroutine that cal...
# android
s
Hey, I want to use a background coroutine that calls some API each X seconds, where should I call it if I’m using few activities and view models and I want to start this job in one place and what should scope should I use? Thank you!
😶 2
r
you might consider using
WorkManger
a
workmanager is likely better suited for longer interval processing. IF Shira is going for updates in units of seconds, I probably would have some appScoped manager or repository fetch within a hot flow, that has while loop iterate the api call every intervals