Features
- Wasm/WASI target support (#4064). Thanks, @igoriakovlev!
limitedParallelism
now optionally accepts the name of the dispatcher view for easier debugging (#4023).- No longer initialize
Dispatchers.IO
on the JVM when other standard dispatchers are accessed (#4166). Thanks, @metalhead8816! - Introduced the
Flow<T>.chunked(size: Int): Flow<List<T>>
operator that groups emitted values into groups of the given size (#1290). - Closeable dispatchers are instances of
AutoCloseable
now (#4123).
Fixes
- Calling
hasNext
on aChannel
's iterator is idempotent (#4065). Thanks, @gitpaxultek! CoroutineScope()
created without an explicit dispatcher usesDispatchers.Default
on Native (#4074). Thanks, @whyoleg!- Fixed a bug that prevented non-Android
Dispatchers.Main
from initializing when the Firebase dependency is used (#3914). - Ensured a more intuitive ordering of tasks in
runBlocking
(#4134). - Forbid casting a
Mutex
toSemaphore
(#4176). - Worked around a stack overflow that may occur when calling
asDeferred
on aFuture
many times (#4156).
Deprecations and promotions
- Advanced the deprecation levels for
BroadcastChannel
-based API (#4197). - Advanced the deprecation levels for the old
kotlinx-coroutines-test
API (#4198). - Deprecated
Job.cancelFutureOnCompletion
(#4173). - Promoted
CoroutineDispatcher.limitedParallelism
to stable (#3864). - Promoted
CoroutineStart.ATOMIC
fromExperimentalCoroutinesApi
toDelicateCoroutinesApi
(#4169). - Promoted
CancellableContinuation.resume
with anonCancellation
lambda to stable, providing extra arguments to the lambda (#4088). - Marked the classes and interfaces that are not supposed to be inherited from with the new
InternalForInheritanceCoroutinesApi
opt-in (#3770). - Marked the classes and interfaces inheriting from which is not stable with the new
ExperimentalForInheritanceCoroutinesApi
opt-in (#3770).