I'm trying to figure out which Dispatcher to use in what case.
I read some documentation and came up with this:
- Default → CPU work
- Main → main (update UI)
- Unconfined
- IO → writing file / network tasks
Is this right?
What about Unconfined?
I'm trying to figure out which Dispatcher to use in what case.
I read some documentation and came up with this:
Is this right?
What about Unconfined?
You're right in your assumptions about the dispatcher types. Unconfined dispatcher –
A coroutine dispatcher that is not confined to any specific thread
Unconfined dispatcher is appropriate when coroutine does not consume CPU time nor updates any shared data (like UI) that is confined to a specific thread.