can I always use WorkManager instead of coroutines?

后端 未结 5 1653
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 01:53

I wonder why should I bother with rx or coroutines when there is brilliant solution as WorkManager. But for almost all tutorials they use coroutines so may be WorkManager has di

5条回答
  •  天涯浪人
    2021-02-09 02:20

    Has others replied, WorkManager solves a different problem than Kotlin's corountines or a reactive library like RxJava.

    WorkManager is now available as beta and additional documentation is produced that hopefully makes this clear. One of these documents is the blog post I worte with some colleagues: Introducing WorkManager, where you can read:

    A common confusion about WorkManager is that it’s for tasks that needs to be run in a “background” thread but don’t need to survive process death. This is not the case. There are other solutions for this use case like Kotlin’s coroutines, ThreadPools, or libraries like RxJava. You can find more information about this use case in the guide to background processing.

提交回复
热议问题