In our app there are so many queries and now we are using ROOM , I want to confirm that what is proper way to use Coroutine before we was using like this
In Dao
@Query("SELECT * FROM VISITS")
suspend fun getAllVisits(): List<Visits>
And we are getting like this
fun getAll(visit: Visits?) = runBlocking {
Log.i(TAG, "addOrUpdateRecord")
try {
val list = ArrayList<Visits>()
list.addAll(async {
visitsDao.getAllVisits()
}.await())
}
But in some articale i have read that runblocking is for only testing not production please guide me proper way Thank you