```val coroutineContext = parentScope.coroutineCon...
# coroutines
m
Copy code
val coroutineContext = parentScope.coroutineContext + CoroutineName("foo")
Is there a difference between
GlobalScope.launch(coroutineContext) {…}
and
CoroutineScope(coroutineContext).launch {…}
?
👀 1
l
Under the hood, the second one will have 2
Job
instances created, unlike the first one. Other than this slight quite unnoticeable difference, the behavior is strictly the same.
m
Thanks. I saw the first one being used in the coroutines library and was wondering. The second one seems more logical as an API user as I have a
CoroutineContext
and need a
CoroutineScope
and there is that neat factory 😄