<Convey intended thread type (IO, default, main) w...
# stackoverflow
u
Convey intended thread type (IO, default, main) when declaring suspend function When designing an API with a suspend function, sometimes I want to convey that this function should be called on, say, an IO thread. Other times that it is essential to do so. Often it seems obvious; for example a database call should be called using Dispatchers.IO but if it's an interface function, then the caller cannot assume this. What is...