kotlinx.coroutines
kotlinx.coroutines copied to clipboard
Library support for Kotlin coroutines
Adds feature #3806 This adds the "scanNotNull" function as an extension to the Flow class. The "scanNotNull" function allows folding the flow's values using a provided operation and emitting every...
The texts in the "Dispatchers and threads" and "Unconfined vs confined dispatcher" sections explicitly mention the example code having `runBlocking` call somewhere but the sample code does not show the...
**What do we have now?** It's possible to pass `Job` as part of context to the mentioned functions: ``` withContext(Job()) { ... } cs.launch(Job()) { ... } cs.async(Job()) { ......
Consider the following hypothetical object that keeps a list of weak references to attached listeners: ```kotlin object Foo { private val listeners = CopyOnWriteArrayList>() fun addListener(listener: () -> Unit) =...
**Describe the bug** When there is an infinite loop in a background scope coroutine, calling `runCurrent()` in test will cause test to lock up, ignoring the timeout. **Provide a Reproducer**...
In IJ we have huge amount of old Java code. Sometimes we want to track certain behaviour or turn on assertions depending on whether the code is running under a...
I was doing some trace analysis for an Android application and I noticed that CoroutineScope#cancel was taking up a very large part of this particular microbenchmark run (1/3rd of total...
`-javaagent` is not a production-level solution for IJ, so IJ enables coroutine debugger dynamically at very early stage of application start up: ``` DebugProbes.enableCreationStackTraces = false DebugProbes.install() ``` **What do...
Steps to reproduce: ``` // Add this test to JobChildStressTest @Test fun testFailingChildIsAddedWhenJobFinalizesItsState() { // All exceptions should get aggregated here repeat(N_ITERATIONS) { runBlocking { val rogueJob = AtomicReference() println(it)...