Skip to content

Doc: Better example for scope builder section of documentation #1439

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

Closed
kazemihabib opened this issue Aug 14, 2019 · 0 comments
Closed

Doc: Better example for scope builder section of documentation #1439

kazemihabib opened this issue Aug 14, 2019 · 0 comments
Labels
docs KDoc and API reference

Comments

@kazemihabib
Copy link

kazemihabib commented Aug 14, 2019

The code sample for the scope builder section of documentation confuses the new readers.

The problem is the documentation says

The main difference between runBlocking and coroutineScope is that the latter does not block the current thread while waiting for all children to complete.

but the code example below that quote, doesn't show the mentioned difference, because "Coroutine scope is over" is not printed until the nested launch completes so and the new readers might think it's blocking too and confuses them.
Consider this question in stackoverflow
and this one in discuss.kotlin

Changing that example that shows the suspending of the coroutineScope and blocking of runBlocking might help new readers.

@elizarov elizarov added the docs KDoc and API reference label Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs KDoc and API reference
Projects
None yet
Development

No branches or pull requests

2 participants