Comments (8)
Hi !
First:
You should guarantee that migration performs not in the parallel. Otherwise it may cause inconsistency after storing migrated values because you can't determinate ordering of operations from multiple threads while instantiates multiple instances of preferences.
Second:
Generally you should persist and fetch all values from preferences on main thread, it does not affect any performance because all data stores in-memory and disk IO performs in separated background thread queue.
Thanks for question.
from binaryprefs.
Thanks for the reply!
from binaryprefs.
Hi @iamironz!
I'm migrating project to binaryprefs but faced with main thread restriction. And that is only one thing that prevents me from using this cool lib :) Basically on my project it's guaranteed that migration will be performed correctly. Also prefs in my project are part of data layer which is completely async. Would be better to make option to build Preferences without main thread checking. What do you think if I create PR to fix that?
from binaryprefs.
This check requires to use Looper from android SDK so now it is impossible to use that library in JVM tests
from binaryprefs.
Please, don't test my code inside yours unit tests, use repo interfaces instead
from binaryprefs.
@iismagilov hey, PR is already approved and will be merged in the next release
from binaryprefs.
@iamironz Cool! I've just updated PR with addition description for new allowBuildOnBackgroundThread()
builder method.
from binaryprefs.
Merged! #46
from binaryprefs.
Related Issues (20)
- Problem with getting data from Set<String> HOT 5
- Incorrect state of contains method of BinaryPrefs after creation HOT 4
- editor.clear() not clears prefs HOT 4
- Add lazy evaluation for default values HOT 4
- Impossible to use without Android HOT 1
- FileChannel#write is now removed from 28 dp1 api
- How to make changes in Persistable class HOT 5
- External storage sometimes is empty line
- Encryption key update HOT 4
- Support for Lists, Sets and Arrays HOT 4
- RuntimeException: Unable to start receiver com.ironz.binaryprefs.dump.DumpReceiver HOT 3
- Can't create preferences directory in /mnt/expand/ HOT 1
- So the inter process part is asynchronized? HOT 1
- Change UnsupportedClassVersionError error to an meaningful
- In-memory cache of byte array is vulnerable for external modifications HOT 3
- 🐞Bug with encryption HOT 3
- Create a ktx module
- Could you release the new version with current changes please? HOT 5
- Clear all prefs at once
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binaryprefs.