Code Monkey home page Code Monkey logo

Comments (8)

iamironz avatar iamironz commented on June 5, 2024

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.

IamEgor avatar IamEgor commented on June 5, 2024

Thanks for the reply!

from binaryprefs.

iismagilov avatar iismagilov commented on June 5, 2024

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.

nekdenis avatar nekdenis commented on June 5, 2024

This check requires to use Looper from android SDK so now it is impossible to use that library in JVM tests

from binaryprefs.

iamironz avatar iamironz commented on June 5, 2024

Please, don't test my code inside yours unit tests, use repo interfaces instead

from binaryprefs.

iamironz avatar iamironz commented on June 5, 2024

@iismagilov hey, PR is already approved and will be merged in the next release

from binaryprefs.

iismagilov avatar iismagilov commented on June 5, 2024

@iamironz Cool! I've just updated PR with addition description for new allowBuildOnBackgroundThread() builder method.

from binaryprefs.

iamironz avatar iamironz commented on June 5, 2024

Merged! #46

from binaryprefs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.