Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public experimental shutdown method on DefaultDispatcher #2652

Closed
wants to merge 9 commits into from

Conversation

mvicsokolova
Copy link
Contributor

Fixes #2491

kotlinx-coroutines-core/common/src/Dispatchers.common.kt Outdated Show resolved Hide resolved
* - On Kotlin/Native requests termination of the worker created by the [Default] dispatcher.
*/
@ExperimentalCoroutinesApi
public fun CoroutineDispatcher.shutdown()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signature seems to be not really usable because it has two receivers and also has effect only on the default dispatcher in K/N which is a bit weird.

I'd suggest sticking with Dispatchers.shutdownDefaultDispatcher while we don't have a separate type for Dispatchers.Default and cannot do Dispatchers.Default.shutdown().

* Provides newSingleThreadedContext.
* Provides Dispatchers.Main on iOS, Dispatchers.Default everywhere.
* Coroutine references (Job), all kinds of channels and StateFlow are shareable across workers.
* Each individual coroutine is confined to a single worker.
* Update Dispatchers docs to account for native-mt changes.
* Multithreaded support in select expression.
* Fix ObjC autorelease object leaks with native-mt dispatchers (#2477)

Additional fixes:
* Fixed broadcast builder with different thread
* Fixed adding a child to a frozen parent job

Fixes #462
Fixes #470
Fixes #765
Fixes #1645
Fixes #1751
Fixes #1828
Fixes #1831
Fixes #1764
Fixes #2064
Fixes #2025
Fixes #2226
Fixes #2138
Fixes #2263
Fixes #2322
Fixes #2283
Fixes #2688
@mvicsokolova mvicsokolova marked this pull request as ready for review June 21, 2021 18:34
@qwwdfsad qwwdfsad force-pushed the native-mt branch 3 times, most recently from 8df9c27 to 48cf2cf Compare July 12, 2021 13:32
@qwwdfsad qwwdfsad force-pushed the native-mt branch 3 times, most recently from e0f92a6 to 386640c Compare September 2, 2021 11:27
@qwwdfsad
Copy link
Member

Closing as won't fix

@qwwdfsad qwwdfsad closed this Sep 27, 2021
@qwwdfsad qwwdfsad deleted the defalut-dispatcher-shutdown branch October 12, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants