wcaokaze
05/30/2018, 10:15 AMspand
05/30/2018, 11:45 AMspierce7
05/31/2018, 5:21 AMDarshan Mistry
05/31/2018, 11:30 AMdave08
05/31/2018, 5:25 PMthevery
05/31/2018, 9:32 PMjw
06/01/2018, 2:12 PMthevery
06/03/2018, 1:37 AMpackage com.thevery.sample.dexcount
import android.support.annotation.Keep
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.launch
class DexCountHelper {
private val labelsToMark = setOf<String>()
private val originalState = mapOf<String, MarkedState>()
enum class MarkedState {
MARKED_ALL, MARKED_SOME, MARKED_NONE
}
@Keep
fun coroutines() {
val finalLabelToMark = labelsToMark.filter { lid -> originalState[lid] != MarkedState.MARKED_ALL }
launch(CommonPool) {
// +2 methods here :(
// val finalLabelToMark = labelsToMark.filter { lid -> originalState[lid] != MarkedState.MARKED_ALL }
println("finalLabelToMark = $finalLabelToMark")
}
}
}
voddan
06/04/2018, 6:25 AMCommonPool + CoroutineName("hi")
behaves? Does it allocate new threads (if yes, how many) or reuses threads from CommonPool
? How come?gildor
06/04/2018, 6:31 AMLex Luthra
06/05/2018, 3:42 AMOlekss
06/05/2018, 5:57 AMsdeleuze
06/05/2018, 1:06 PMgildor
06/07/2018, 8:25 AMval job = launch {
println("Do something")
}
job.join()
assertTrue(job.isCompleted)
assertTrue(!job.isCancelled)
println("isCompleted ${job.isCompleted}, isCancelled ${job.isCancelled}")
//output: isCompleted true, isCancelled false
elizarov
06/07/2018, 8:30 AMJob()
had completed “normally” or “was cancelled”. You can tell the difference (between normal completion and cancellation) with isCancelled
and that is the only difference. Just use cancel()
in all cases and don’t use isCancelled
.gildor
06/07/2018, 4:29 PMLex Luthra
06/08/2018, 4:40 AMacando86
06/08/2018, 11:45 AMzak.taccardi
06/08/2018, 9:28 PMChannel<T>
that supports consuming items from it, but one that can be unsubscribed from and remain open. Is this possible? https://stackoverflow.com/questions/50768585/consumable-channelDaniel Tam
06/09/2018, 3:57 PMthomasnield
06/09/2018, 7:29 PMtreeRowCount
. Thoughts on an implementation?wickedev
06/10/2018, 8:39 AMelizarov
06/11/2018, 8:14 AMgildor
06/11/2018, 8:48 AMCancallableContunuationImpl
, AbstractChannel.ReceiveHasNext
, ChildContinuation
, ConflatedBroadcastChannel.State
and lambda of ReceiveChannel.consume
.
Isn’t this too much? It’s fine for many cases. But if you want to work with UI drawing events (60 per second in case of Android) it looks like significant overheadelizarov
06/11/2018, 9:20 AMkotlinx.coroutines
version 0.23.1
fixes JS version in NPM (adds missing dependency) and introduces broadcast
builder for JVM&JS. https://github.com/Kotlin/kotlinx.coroutines/releases/tag/0.23.1louiscad
06/11/2018, 12:49 PMselect
expression? If yes, for what use cases?withoutclass
06/12/2018, 2:29 PMDaniel Tam
06/13/2018, 6:11 AMrattleshirt
06/13/2018, 9:58 AMjava.lang.NoSuchMethodError: No virtual method refresh(Lkotlin/Unit;Lkotlin/coroutines/experimental/Continuation;)Ljava/lang/Object;
when calling a suspend fun with param Unit
? Is this a coroutine or dex’ing issue?Daniel Tam
06/13/2018, 11:01 AMDaniel Tam
06/13/2018, 11:01 AMspand
06/13/2018, 11:17 AMTestCoroutineContext
then I think some of them are in the queue
property. Not sure if it is all of themDaniel Tam
06/13/2018, 12:25 PM