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

Investigate possible shortcuts for coroutineContext.job.invokeOnCompletion { if (it != null) ... } #3259

Open
qwwdfsad opened this issue Apr 19, 2022 · 0 comments

Comments

@qwwdfsad
Copy link
Collaborator

qwwdfsad commented Apr 19, 2022

The pattern itself is useful for any closeable resources that face non-atomic cancellation (#1191) as the only reliable way to close it.

Apart from that, the pattern itself is very clunky, but seems to be quite frequent: [1], [2].

We should investigate whether we can provide more convenient extensions on top of CoroutineContext and CoroutineScope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant