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

Introduce Job.parent API #3384

Merged
merged 3 commits into from
Jul 29, 2022
Merged

Introduce Job.parent API #3384

merged 3 commits into from
Jul 29, 2022

Conversation

qwwdfsad
Copy link
Contributor

  • The API is crucial for debugger extension and deadlock detection
  • It enables allows more fluent coroutines hierarchy inspection, e.g. capability to build a list of roots and procrss them top-bottom separately

Fixes #3201

* The API is crucial for debugger extension and deadlock detection
* It enables allows more fluent coroutines hierarchy inspection, e.g. capability to build a list of roots and procrss them top-bottom separately

Fixes #3201
* Always returns `null`.
* @suppress **This an internal API and should not be used from general code.**
*/
@Deprecated(level = DeprecationLevel.WARNING, message = message)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to add ReplaceWith(null) to allow for automatic replacements in bulk? I don't see the downsides.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, it rather means that the whole usage of this API is incorrect and it's time to rethink what is written :)

kotlinx-coroutines-core/common/src/Job.kt Outdated Show resolved Hide resolved
Comment on lines +124 to +126
* Accesses to this property are not idempotent, the property becomes `null` as soon
* as the job is transitioned to its final state, whether it is cancelled or completed,
* and all job children are completed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Accesses to this property are not idempotent, the property becomes `null` as soon
* as the job is transitioned to its final state, whether it is cancelled or completed,
* and all job children are completed.
* Accesses to this property are not idempotent: the property becomes `null` as soon
* as the job is transitioned to its final statewhether it is cancelled or completed
* and all job children are completed.

Do we allow Unicode in comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer to avoid it, we never know whether Dokka and kotlinlang support it

Copy link
Contributor

Choose a reason for hiding this comment

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

This argument cuts both ways: we may treat this as a good chance to find out. I don't care that much though.

kotlinx-coroutines-core/common/src/Job.kt Outdated Show resolved Hide resolved
qwwdfsad and others added 2 commits July 29, 2022 18:49
Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com>
Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com>
@qwwdfsad qwwdfsad merged commit 3120530 into develop Jul 29, 2022
@qwwdfsad qwwdfsad deleted the job-parent branch July 29, 2022 19:48
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