We are just moving our app from Firebase to Couchbase, and I was just about to change the code to use a custom dispatch queue for performance reasons. Does running on a custom dispatch queue actually work?
Thanks! Jordan On Monday, November 16, 2015 at 1:23:30 AM UTC-6, Brendan Duddridge wrote: > > Hi, > > So I'm using a custom dispatchQueue on my CBLDatabase in order to be able > to process large numbers of CBLModel objects. For example, I may be > importing thousands of lines from a CSV file or migrating to Couchbase from > an older version of my database schema. I want these large database > operations to be performed on a background thread so that I can have the > main thread update things like progress bars and status updates. > > That all works great so far. > > However, I ran into a problem with replication. Because replication > happens on a background thread, the KVO notifications of objects being > created isn't happening on the main thread so I'm getting crashes. > > The debugger tends to stop on the willChangeValueForKey line of the > following snippet in CBLModel in the document:didChange: method. > > // Prepare to send KVO notifications about all my properties in case > they changed: > > NSSet* keys = [[self class] propertyNames]; > > for (NSString* key in keys) > > [self willChangeValueForKey: key]; > > > To work around this problem I've stopped using my custom dispatchQueue, > but that also means I am unable to update the UI to show progress > indicators and status messages. > > Is there a proper way to be showing progress indicators without having the > database access go through a custom dispatchQueue? > > thanks, > > Brendan > > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/33c5df95-1718-4645-ba5d-a95146ad715a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
