Question for the coroutine masters. I found this c...
# coroutines
c
Question for the coroutine masters. I found this code in the coroutine library and I asked myself, in which context is this block running on. I gave myself an answer: "In whatever context withTimeout is called". So If i run this in a runBlocking ran from main thread, the timeout block will still run on main thread. What do you reckon? Furthermore since withTimeout doesn't have a context parameter, if I want to run it into another context, then I need to include it into another coroutine builder which accepts context, subsequently withTimout will run on that same context.
o
yes, it will inherit the context of the parent function, if you want a different context, use
withContext
either around or inside
👍 1