is there a way to assert which dispatcher you’re o...
# coroutines
a
is there a way to assert which dispatcher you’re on?
d
You can check with
coroutineContext[CoroutineDispatcher]
.
a
niceeee
g
Check (or even assert) may be fine in some cases, bit usually better to switch on dispatcher which is needed without check
a
Is there a way to get the current context without a scope? Looks like there is an internal way to do it but nothing public.
g
you don’t need scope to get current context
coroutineContext property available in every suspend lambda/function
d
coroutineContext
is a top level property.
g
coroutineContext in scope is not the same, it’s not your runtime context, but rather a way to get new context instance to start new coroutine
a
👍