Main function:
val users = CoroutineScope(Dispatchers.IO).launch{readFile()}.toString()
readFile:
suspend fun readFile(): String = withContext(Dispatchers.IO){
.............
return@withContext fullString
}
I'm not sure if my code is good, because im creating 2 coroutines. first one is by using CoroutineScope (Dispatchers.IO) and second one is in readfile using withContext. what is the best approach to this?
Read file using coroutines