Giter Club home page Giter Club logo

Comments (2)

danieleggert avatar danieleggert commented on September 27, 2024

Similar to your question #9 — this is for two reasons: (A) threading reasons. The init code may not run on the thread that the SyncCoordinator should use. Secondly, an explicit call to setup allows us to create the SyncCoordinator, do additional configuration (e.g. setting a delegate) and only then trigger the setup. In the trivial example code that's not needed, but we still wanted to show that pattern.

It’s probably overwhelming, but you may want to take a look at https://github.com/wireapp/zmessaging-cocoa — it uses a similar architecture.

from core-data.

timarnold avatar timarnold commented on September 27, 2024

Does the Moody sample app actually require that the setup methods be called on the sync MOC's thread (using performGroupedBlock), or is this again just an illustration of a best practice?

Thanks for your answers --- I had the vague idea it was "for doing things safer while using multiple threads", but I just haven't yet found a resource that has allowed me to understand what the specific dangers are and when one encounters them. For example, in the case that my app only ever has one SyncCoordinator, is all of this a bit overkill, demonstrating best multi-threaded practices but not actually necessary? Do I only need to worry about this sort of stuff if I have less control over how my SyncCoordinator is used?

from core-data.

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.