kotlinx.coroutines
kotlinx.coroutines copied to clipboard
Library support for Kotlin coroutines
The coroutines are using atomic reference implementation backed by `Atomic*FieldUpdater` which is 2x slower for `compareAndSet` and `set` when compared to `AtomicReference` on Android devices. Running the [benchmark](https://github.com/ShikaSD/benchmark-playground/blob/main/benchmark/src/androidTest/java/com/example/compose/benchmark/AtomicReferenceBenchmark.kt) on Pixel...
**Describe the bug** Sometimes `DebugProbes.install` fails with the following: ``` Caused by: java.lang.IllegalStateException: The Byte Buddy agent is not installed or not accessible at kotlinx.coroutines.repackaged.net.bytebuddy.dynamic.loading.ClassReloadingStrategy.fromInstalledAgent(ClassReloadingStrategy.java:171) at kotlinx.coroutines.debug.internal.ByteBuddyDynamicAttach.attach(Attach.kt:29) at kotlinx.coroutines.debug.internal.ByteBuddyDynamicAttach.invoke(Attach.kt:17) at...
**Use case** I’m using Kotlin/JS. I’d like a public API to install a platform exception handler. As-is my uncaught exceptions are going to console.log, where they’re invisible to my observability...
/docs/topics/exception-handling.md The "Supervision" section appears to be wrong throughout its text by using the term "cancellation" instead of the term "failure". I.e. the text is suggesting it is about "cancel()",...
Currently, when coroutines debug mode is enabled, the following machinery is enabled: * Every coroutine created is supplied with `CoroutineId`. This one might be useful for local debugging and logging,...
An example was submitted to us (slightly simplified): ```kotlin runBlocking { val sharedFlow = MutableSharedFlow() val stateFlow = sharedFlow.stateIn(this, SharingStarted.Eagerly, 0) check(stateFlow.value == 0) sharedFlow.emit(1) delay(1.seconds) check(stateFlow.value == 1) //...
This is known error. Some libraries have not done anything (https://github.com/google/gson/issues/924) other ones have implemented workaround (https://github.com/ReactiveX/RxJava/issues/3459). Couple of stacktraces from my project: [com.mirrorai.app_issue_crash_5D5E4CFA0353000119B5FCFF34F93B11_DNE_0_v2.txt](https://github.com/Kotlin/kotlinx.coroutines/files/3550456/com.mirrorai.app_issue_crash_5D5E4CFA0353000119B5FCFF34F93B11_DNE_0_v2.txt) [com.mirrorai.app_issue_crash_5D61DBF600A40001134DD9BDD9BD8B29_DNE_0_v2.txt](https://github.com/Kotlin/kotlinx.coroutines/files/3550457/com.mirrorai.app_issue_crash_5D61DBF600A40001134DD9BDD9BD8B29_DNE_0_v2.txt) I'm not convincing you to...
**Use case** Hi, all. Our tracing system is based on ThreadLocal. To not lose changes to our ThreadLocal, we store the object in `CopyableThreadContextElement`. ``` ThreadLocal.set(trace) withContext(context) { // copyForChild()...