androidsharedpreferencesandroid-jetpack-datastore

DataStore thread execution


I am curious about on which thread does the SharedPreferences substitute - Preferences DataStore operate - read and write data.

I searched for information but couldn't find any, only one article - this one https://medium.com/@vgoyal_1/datastore-android-how-to-use-it-like-a-pro-using-kotlin-2c2440683d78 and it is the first place where I see it is mentioned on which thread are the operations executed.


Solution

  • As the DataStore code labs states - Dispatchers.IO - https://developer.android.com/codelabs/android-proto-datastore#3