Dmytro Danylyk
03/07/2017, 10:06 AMrunBlocking
in test function to wrap my original code which uses launch(CommPool)
?bamdmux
03/07/2017, 12:39 PMkingsley
03/07/2017, 1:58 PMAndroidDispatcher.Main
?orangy
03/07/2017, 2:47 PMPrimary
?jw
03/07/2017, 6:58 PMmfulton26
03/07/2017, 7:04 PMIterable<T>.forEachConcurrently
?v0ldem0rt
03/09/2017, 5:23 AMRuckus
03/09/2017, 7:45 PMkenkyee
03/12/2017, 11:15 AMorangy
03/13/2017, 5:31 PMpabl0rg
03/14/2017, 8:22 AMdeviant
03/14/2017, 9:06 AMwhat is the main benefit of using coroutines instead?non-blocking code? 🙂
groostav
03/14/2017, 10:03 PMPredicate<Node>
, can I use a suspend fun
to avoid all the queue offer
and remove
malarky?kirillrakhman
03/15/2017, 9:55 AMkirillrakhman
03/15/2017, 11:57 AM<http://handler.post|handler.post>(block)
in HandlerContext
?kirillrakhman
03/15/2017, 12:38 PMWarning:Ignoring Android API artifact com.google.android:android:2.3.1 for debug
. Can the dependency in kotlinx-coroutines-android be declared as compile time only so that the warning disappears?robin
03/15/2017, 2:33 PMgildor
03/17/2017, 12:58 AMhttps://www.youtube.com/watch?v=Ztr8QvMhqmQ▾
gildor
03/17/2017, 12:59 AMelizarov
03/17/2017, 10:28 AMuhe
03/17/2017, 2:26 PMval channel = Channel<Int>()
launch(CommonPool) {
delay(50)
println("Closing and flushing channel")
channel.closeAndFlush()
}
(0..3).map { number ->
launch(context) {
println("Sending $number")
channel.send(number)
println("$number sent")
}
}.forEach { it.join() }
println("Done!")
which prints:
Sending 0
Sending 1
Sending 2
Sending 3
Closing and flushing channel
0 sent
1 sent
2 sent
3 sent
Done!
elizarov
03/17/2017, 3:24 PMkotlinx.coroutines
version 0.14
with significant fixes related to reactive stream modules. Change log is here: https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.mdjmfayard
03/18/2017, 9:00 AMdeviant
03/18/2017, 2:52 PMkingsley
03/18/2017, 4:32 PMclear
and cancel
on a composite disposable in Rx
I have a situation where the parent job should live longer than it's children.moelholm
03/18/2017, 9:00 PMdeviant
03/19/2017, 3:20 PMlist.forEachIndexed
. i need the items order to be preserved, but each item should be processed in a separate thread (pool of 4 threads). is it a good idea to implement it via channels?deviant
03/19/2017, 8:35 PMdeviant
03/19/2017, 8:37 PMrx -> coroutines
in one of my projects. totally happy so far 🙂kirillrakhman
03/20/2017, 8:28 AMuse
style code but don't want additional allocations.kirillrakhman
03/20/2017, 8:28 AMuse
style code but don't want additional allocations.elizarov
03/20/2017, 8:30 AMkirillrakhman
03/20/2017, 8:31 AMelizarov
03/20/2017, 8:31 AMkirillrakhman
03/20/2017, 8:32 AMinline fun launchWithDismiss(block: suspend () -> Unit) = launch(handleExceptions = true) {
try {
block()
} finally {
dismissAllowingStateLoss()
}
}
is this also covered by the issue?elizarov
03/20/2017, 8:37 AMblock
param. Should also work without “noinline” modifier if the issue I’ve quoted is fixed.kirillrakhman
03/20/2017, 8:39 AMinline
with noinline
and leaving out inline
altogether, right?elizarov
03/20/2017, 8:40 AMlaunch
, then you don’t need it.CoroutineExceptionHandler
kirillrakhman
03/20/2017, 8:42 AMelizarov
03/20/2017, 8:42 AMval job = launch(context) { … doSomething ... }
launch(context + NonCancellable) { // !!!
job.await()
dismissAllowingStateLoss()
}
kirillrakhman
03/20/2017, 8:44 AMelizarov
03/20/2017, 8:44 AMkirillrakhman
03/20/2017, 8:45 AMelizarov
03/20/2017, 8:46 AMdismiss
when the original code completes (including whatever other cleanup there was), while my code invokes dismiss
as soon as the job is cancelled (it may invoke dismiss
before doSomething
code had terminated)kirillrakhman
03/20/2017, 8:49 AMdeviant
03/20/2017, 9:25 AMkirillrakhman
03/20/2017, 9:27 AMDialogFragment
that has retainInstance = true
deviant
03/20/2017, 9:28 AMkirillrakhman
03/20/2017, 9:29 AM