Hi,
I propose renaming of coroutineScope function to runScoped.
runBlocking and coroutineScope and by observation seems many people thinks that coroutineScope is like launch (not blocks / suspends), maybe by renaming function to runScoped would help to associate it with runBlocking and helps to know(feel) that this call is also blocking / suspending. coroutineScope is a noun and feels like it would create a block of scope and returns it, but actually it runs a given block and returns block's result value, runScoped will reveal intention more clearly.fun CoroutineScope(), interface CoroutineScope.I completely agree this function is the main source of confusion in coroutines channel of Kotlin slack the last few months.
Some time ago I proposed another name awaitScope, but probably runScope is better name 馃憤
I do agree with the confusion that It makes. Although something other than run might be better.
Maybe joinScope is a good name?
I agree with this confusion name and prefer a name like runBlockingScope, this kind of name can emphasize this call will block the coroutine like the runBlocking block the current thread.
Any use of the word "blocking" is completely out of the question. To avoid confusion we explicitly reserve the word blocking for cases when the thread is block and use the term "suspension" to refer to case when coroutines wait for anything without blocking a thread.
Most helpful comment
Any use of the word "blocking" is completely out of the question. To avoid confusion we explicitly reserve the word blocking for cases when the thread is block and use the term "suspension" to refer to case when coroutines wait for anything without blocking a thread.