Dave Jensen
01/31/2020, 12:21 AMDave Jensen
01/31/2020, 12:22 AMDave Jensen
01/31/2020, 12:22 AMoctylFractal
01/31/2020, 12:23 AMList<Deferred<T>>, awaitAll(): List<T>Dave Jensen
01/31/2020, 12:26 AMDave Jensen
01/31/2020, 12:30 AMoctylFractal
01/31/2020, 12:32 AMoctylFractal
01/31/2020, 12:33 AMFlow may be useful, but it doesn't yet have good concurrency primitives, it's best for serial processing. You can emulate concurrent processing by using .map { async { } } and .buffered, but it's certainly more complex than thisDave Jensen
01/31/2020, 12:48 AMgetInt contains a blocking call? Like an http library that doesn't support coroutines?octylFractal
01/31/2020, 12:49 AMsuspend function + withContext(<http://Dispatchers.IO|Dispatchers.IO>), e.g.:
suspend fun suspendGetInt(i: Int) = withContext(<http://Dispatchers.IO|Dispatchers.IO>) { getInt(i) }octylFractal
01/31/2020, 12:50 AMoctylFractal
01/31/2020, 12:50 AMDave Jensen
01/31/2020, 12:55 AMDave Jensen
01/31/2020, 1:03 AMoctylFractal
01/31/2020, 1:05 AMDave Jensen
01/31/2020, 1:05 AMoctylFractal
01/31/2020, 1:06 AM.then is basically a callback)