Gioele Dev
12/04/2022, 3:09 PMviewModelScope.launch( <http://Dispatchers.IO|Dispatchers.IO>)
is it correct ?Morgane Soula
12/04/2022, 3:35 PMGioele Dev
12/04/2022, 3:59 PMuli
12/04/2022, 4:06 PMuli
12/04/2022, 4:07 PMuli
12/04/2022, 4:08 PMuli
12/04/2022, 4:11 PMsuspend fun Socket.readMyData(int count) : ByteArray = withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
return read(count)
}
So no one downstream needs to guess, what the method is doing and which dispatcher is the right one to call it on.uli
12/04/2022, 4:12 PMuli
12/04/2022, 4:13 PM