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

Document and tweak the contract of Executor.asCoroutineDispatcher and ExecutorService.asCoroutineDispatcher #2727

Merged
merged 2 commits into from May 25, 2021

Conversation

qwwdfsad
Copy link
Member

* Document it properly
* Make it more robust to signature changes and/or delegation (e.g. see the implementation of java.util.concurrent.Executors.newScheduledThreadPool)
* Give a public way to reduce the memory pressure via ScheduledFuture.cancel

    * Reuse the same class for both asCoroutineDispatcher and newFixedThreadPoolContext
    * Replace 3-classes hierarchy by a single impl class
    * Copy the auto-closing logic to test source
… ExecutorService.asCoroutineDispatcher

    * Document it properly
    * Make it more robust to signature changes and/or delegation (e.g. see the implementation of java.util.concurrent.Executors.newScheduledThreadPool)
    * Give a public way to reduce the memory pressure via ScheduledFuture.cancel

Fixes #2601
@qwwdfsad qwwdfsad requested a review from elizarov May 24, 2021 18:45
@qwwdfsad qwwdfsad marked this pull request as ready for review May 24, 2021 18:45
Copy link
Contributor

@elizarov elizarov left a comment

Choose a reason for hiding this comment

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

👍

@qwwdfsad qwwdfsad merged commit 5121005 into develop May 25, 2021
@qwwdfsad qwwdfsad deleted the as-dispatcher-delay branch May 25, 2021 12:07
anastasiiaSpaseeva-zz pushed a commit that referenced this pull request Jun 4, 2021
…cher and ExecutorService.asCoroutineDispatcher (#2727)"

This reverts commit 5121005
anastasiiaSpaseeva-zz pushed a commit that referenced this pull request Jun 5, 2021
…cher and ExecutorService.asCoroutineDispatcher (#2727)"

This reverts commit 5121005
pablobaxter pushed a commit to pablobaxter/kotlinx.coroutines that referenced this pull request Sep 14, 2022
… ExecutorService.asCoroutineDispatcher (Kotlin#2727)

* Get rid of ThreadPoolDispatcher and PoolThread classes
* Reuse the same class for both asCoroutineDispatcher and newFixedThreadPoolContext
* Replace 3-classes hierarchy by a single impl class
* Copy the auto-closing logic to test source

* Document and tweak the contract of Executor.asCoroutineDispatcher and ExecutorService.asCoroutineDispatcher
* Document it properly
* Make it more robust to signature changes and/or delegation (e.g. see the implementation of java.util.concurrent.Executors.newScheduledThreadPool)
* Give a public way to reduce the memory pressure via ScheduledFuture.cancel

Fixes Kotlin#2601
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

2 participants