# Does CoroutineScope coroutineContext carry to default context for any of that class's "launch"?

**URL:** <https://discuss.kotlinlang.org/t/does-coroutinescope-coroutinecontext-carry-to-default-context-for-any-of-that-classs-launch/13121>\
**Category:** Support\
**Created:** [June 17, 2019, 8:05pm UTC](https://discuss.kotlinlang.org/t/does-coroutinescope-coroutinecontext-carry-to-default-context-for-any-of-that-classs-launch/13121 "2019-06-17T20:05:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjaminhill](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@benjaminhill](https://discuss.kotlinlang.org/u/benjaminhill)\
**Post date:** [June 17, 2019, 8:05pm UTC](https://discuss.kotlinlang.org/t/does-coroutinescope-coroutinecontext-carry-to-default-context-for-any-of-that-classs-launch/13121/1 "2019-06-17T20:05:17Z")

</div>

I’ve got what I believe is latest best-practice:

```auto
class BasicBot : CoroutineScope, AutoCloseable, Runnable {
    @Transient
    private val job = Job()

    override val coroutineContext: CoroutineContext
        get() = job + Dispatchers.Default

    override fun run() {
        launch(Dispatchers.Default) {

```

Is that `launch(Dispatchers.Default)` redundant with the previously declared coroutineContext that uses Default? Hard to tell from the docs what influences nested defaults where. Thank you!

_My overall goal is to “Launch stuff on the Default dispatcher so it uses reasonable parallelism, and don’t leave any running when the AutoClosable closes.”_

---

<div class="post-metadata">

**Author:** ![ebrowne72](https://avatars.discourse-cdn.com/v4/letter/e/85f322/32.png) [@ebrowne72](https://discuss.kotlinlang.org/u/ebrowne72)\
**Post date:** [June 17, 2019, 11:31pm UTC](https://discuss.kotlinlang.org/t/does-coroutinescope-coroutinecontext-carry-to-default-context-for-any-of-that-classs-launch/13121/2 "2019-06-17T23:31:11Z")

</div>

Yes, it is redundant. `launch()` is an extension function, so it is equivalent to `this.launch()`, so it uses `this.coroutineContext`’s dispatcher, which in this case is `Dispatchers.Default`.

---

<div class="post-metadata">

**Author:** ![Prototik](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/prototik/32/6489_2.png) [@Prototik](https://discuss.kotlinlang.org/u/Prototik)\
**Post date:** [June 22, 2019, 12:05pm UTC](https://discuss.kotlinlang.org/t/does-coroutinescope-coroutinecontext-carry-to-default-context-for-any-of-that-classs-launch/13121/3 "2019-06-22T12:05:32Z")

</div>

Even more: `Dispatchers.Default` in `coroutineContext` redudant too, coroutine builders will provide default dispatcher if it missing for some reason. But it’s okay to explicitly provide a dispatcher.
