https://kotlinlang.org logo
#coroutines
Title
# coroutines
t

Tgo1014

02/09/2023, 8:54 AM
Copy code
(SupervisorJob() + Dispatchers.Main.immediate) + <http://Dispatchers.IO|Dispatchers.IO>
What happens in the above case? Will it run as
IO
?
yes black 2
🙏 1
h

hfhbd

02/09/2023, 10:06 AM
withContext basically adds the new context to the existing context:
withContext(Main) { withContext(IO) { }}
. Duplicates elements are replaced.
t

Tgo1014

02/09/2023, 11:54 AM
I knew I could switch with
withContext
but for the context construction I wasn't sure 😄
14 Views