Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun launch(f: () -> Unit) {
- GlobalScope.launch {
- f.invoke()
- }
- }
- inline fun <reified T> asyncAndWait(crossinline f: () -> T) = runBlocking {
- return@runBlocking GlobalScope.async(Dispatchers.IO) {
- f.invoke()
- }.await()
- }
Add Comment
Please, Sign In to add comment