can I always use WorkManager instead of coroutines?

后端 未结 5 1640
没有蜡笔的小新
没有蜡笔的小新 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:15

    If your goal is writing clean code without explicitly constructed callbacks you pass to background tasks, then you'll find that coroutines are the only option.

    Using coroutines by no means precludes using WorkManager or any other tool for background operations of your choosing. You can adapt the coroutines to any API that provides callbacks as a means to continue the execution with the results of background operations.

提交回复
热议问题