William Reed
07/12/2021, 2:18 PMsuspend fun
exposed from a library like Retrofit
or Room
or SqlDelight
- is there a need to change the dispatcher to IO
or since they are code generating a suspend fun
is it safe to assume that its ‘main-safe’?jw
07/12/2021, 2:19 PMlouiscad
07/12/2021, 2:23 PMWilliam Reed
07/12/2021, 2:23 PMjw
07/12/2021, 2:30 PMjw
07/12/2021, 2:30 PMlouiscad
07/12/2021, 2:32 PMQuery
objects on <http://Dispatchers.IO|Dispatchers.IO>
to be main-safe. (That is not an argument for Room)William Reed
07/12/2021, 2:37 PMlouiscad
07/12/2021, 2:38 PMWilliam Reed
07/12/2021, 2:39 PMlouiscad
07/12/2021, 2:39 PMWilliam Reed
07/12/2021, 2:40 PMWilliam Reed
07/12/2021, 2:40 PMgildor
07/13/2021, 1:48 AMSudhir Singh Khanger
07/13/2021, 5:47 AMRoom will use different Dispatchers for transactions and queries. These are derived from the executors you provide when building your Database or by default will use the Architecture Components IO executor. This is the same executor that would be used by LiveData to do background work.https://medium.com/androiddevelopers/room-coroutines-422b786dc4c5
Lukas Lechner
07/13/2021, 1:38 PMWilliam Reed
07/13/2021, 1:48 PM