aeruhxi
08/20/2018, 12:23 PMOlekss
08/20/2018, 12:32 PMlittlelightcz
08/20/2018, 5:26 PMlaunchUI {}
for launch(JavaFx) {}
and commonPool {}
for withContext(CommonPool) {}
. If something similar would be considered to be added to the coroutines-javafx and base coroutines libraries, that would be a thumbs up from me 👍🙂bdawg.io
08/21/2018, 2:31 PMContinuation
?JoeHegarty
08/21/2018, 9:26 PMgroostav
08/21/2018, 11:51 PMproduce
that I dont want it to run its block until somebody calls recieve
from it? IE a kind of pull based channel?groostav
08/22/2018, 9:08 PMmuralimohan962
08/23/2018, 4:46 AMaaverin
08/23/2018, 3:24 PMfun funToTest() = async {
registerDevice()
//... and lots of extra logic here
}
private suspend fun registerDevice() = suspendCoroutine {
// handle complex callback logic and do it.resume(data) for suspendCoroutine
}
aaverin
08/23/2018, 3:31 PM@Test
fun `ok result of registration results in success`() = blocking {
val result = classToTest.execute(appConfig).await()
mockRegisterResponseSuccess(ApiResponseStatus.OK)
mockInitAppPurchasesSuccess()
result.should.be.equal(trackingId)
}
elizarov
08/23/2018, 4:44 PMkotlinx.coroutines
version 0.25.0
is released. It has reworked/consistent/documented exception handling model, convenient thread-locals for coroutines, SLF4J MDC integration, and more. See https://github.com/Kotlin/kotlinx.coroutines/releases/tag/0.25.0bj0
08/23/2018, 5:59 PMJobCancellationException
instead of CancellationException
?kevinherron
08/24/2018, 2:32 AMdebounce
extensions for SendChannel
and `ReceiveChannel`… any interest in a PR? anybody else find they’ve needed these?aaverin
08/24/2018, 5:41 AMawait()
call in try/catch I might never ever know that there was an exception inside? Or will that exception then thrown as usual?
fun main(args: Array<String>) = runBlocking {
val job = launch {
println("Throwing exception from launch")
throw IndexOutOfBoundsException() // Will be printed to the console by Thread.defaultUncaughtExceptionHandler
}
job.join()
println("Joined failed job")
val deferred = async {
println("Throwing exception from async")
throw ArithmeticException() // Nothing is printed, relying on user to call await
}
try {
deferred.await()
println("Unreached")
} catch (e: ArithmeticException) {
println("Caught ArithmeticException")
}
}
aaverin
08/24/2018, 5:43 AMasync and produce ... are relying on the user to consume the final exception
– what if user doesn’t consume final exception, will it be thrown out of async/produce or just quietely hidden?louiscad
08/24/2018, 9:38 AMsuspend val
and suspend operator fun getValue
to allow by suspendLazy { ... /* a coroutine */ }
delegation. I'm not sure It's a good idea thoughaaverin
08/24/2018, 12:32 PMasync
only runs when I call await
Paul Woitaschek
08/24/2018, 3:29 PMlouiscad
08/24/2018, 6:23 PMconsume
or consumeEach
.
BTW, this is getting me wondering if for
loop on a channel without consumption
should raise a warning…withoutclass
08/24/2018, 6:23 PMPaul Woitaschek
08/26/2018, 11:08 AMadev_one
08/27/2018, 1:21 PMUI
dispatcher from anko but on iOS
My build.gradle
buildscript {
ext.kotlin_version = '1.2.51'
ext {
coroutines_version = "0.25.0"
}
}
apply plugin: 'kotlin-platform-native'
sourceSets {
main {
component {
baseName.set("NF")
outputKinds = [FRAMEWORK]
target 'ios_arm64', 'ios_x64'//, 'ios_arm32'
}
}
}
dependencies {
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
<...>
}
IosDisplayContext.swift
import NF
@objc
class IosDisplayContext: NSObject, NFCoroutineDispatcher {
}
I’m getting error Use of undeclared type 'NFCoroutineDispatcher'
. How can I implement public protocols of coroutines library by my Swift code?aaverin
08/27/2018, 3:48 PMproduce
somehow, similar to suspendCancellableCoroutine
?
I am trying to have coroutines for Firebase Firestore and they use addSnapshotCallback
to observe hot dataaaverin
08/27/2018, 3:48 PMsend
can only be called in coroutine context, that is hidden by the callback functionkevinherron
08/28/2018, 3:23 AMAbstractChannel
APIs stabilize before release? I may have a use for a Channel
backed by a priority queue but want to re-use as much as possible…tyjka
08/28/2018, 3:33 AMDmytro Danylyk
08/28/2018, 8:37 AMrichodemus
08/29/2018, 8:25 AMdstarcev
08/29/2018, 10:12 AMigorvd
08/29/2018, 12:58 PMError while generating the main dex list
Running with the stacktrace, I can see that this is the cause:
Caused by: com.android.tools.r8.errors.CompilationError: Program type already present: kotlinx.coroutines.experimental.AbstractContinuation
at com.android.tools.r8.utils.ProgramClassCollection.resolveClassConflictImpl(ProgramClassCollection.java:64)
at com.android.tools.r8.utils.ProgramClassCollection.lambda$create$0(ProgramClassCollection.java:25)
at java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:1990)
at com.android.tools.r8.utils.ProgramClassCollection.create(ProgramClassCollection.java:24)
at com.android.tools.r8.graph.LazyLoadedDexApplication$Builder.build(LazyLoadedDexApplication.java:124)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:123)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:86)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:41)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:111)
at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:83)
... 56 more
Searching for jars that contains the AbstractContinuation
, I can see that is present in:
org.jetbrains.kotlinx:kotlin-coroutines-core:0.25.0
org.jetbrains.kotlinx:kotlin-coroutines-core-common:0.25.0
But my only dependency in build.gradle is: org.jetbrains.kotlinx:kotlinx-coroutines-android:0.25.0
I've notice that going back to version 0.23.4 fixed the problem. Maybe it's a bug with the version 0.25.0
. I can't test using the 0.24.0
, because I need the runBlocking
in some parts.igorvd
08/29/2018, 12:58 PMError while generating the main dex list
Running with the stacktrace, I can see that this is the cause:
Caused by: com.android.tools.r8.errors.CompilationError: Program type already present: kotlinx.coroutines.experimental.AbstractContinuation
at com.android.tools.r8.utils.ProgramClassCollection.resolveClassConflictImpl(ProgramClassCollection.java:64)
at com.android.tools.r8.utils.ProgramClassCollection.lambda$create$0(ProgramClassCollection.java:25)
at java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:1990)
at com.android.tools.r8.utils.ProgramClassCollection.create(ProgramClassCollection.java:24)
at com.android.tools.r8.graph.LazyLoadedDexApplication$Builder.build(LazyLoadedDexApplication.java:124)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:123)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:86)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:41)
at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:111)
at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:83)
... 56 more
Searching for jars that contains the AbstractContinuation
, I can see that is present in:
org.jetbrains.kotlinx:kotlin-coroutines-core:0.25.0
org.jetbrains.kotlinx:kotlin-coroutines-core-common:0.25.0
But my only dependency in build.gradle is: org.jetbrains.kotlinx:kotlinx-coroutines-android:0.25.0
I've notice that going back to version 0.23.4 fixed the problem. Maybe it's a bug with the version 0.25.0
. I can't test using the 0.24.0
, because I need the runBlocking
in some parts.dekans
08/29/2018, 1:32 PMigorvd
08/29/2018, 1:36 PMdekans
08/29/2018, 1:46 PMIt seems that you need R8 to be enabled un your gradle.propertiesFrom the comments of this issue. I stick to v0.24 until we have a fix 😞
igorvd
08/29/2018, 1:58 PM