Reporting back here. Worked like a charm! Thanks Jens!
On Thursday, January 21, 2016 at 4:14:08 PM UTC-7, Brendan Duddridge wrote: > > Hi Jens, > > Ah ok. That's a great idea. I have something like that already for > updating the NSNetService TXT record for peer-to-peer syncing. Not sure why > I didn't also use it to update the UI. I'll do that now. > > Thanks! > > On Thursday, January 21, 2016 at 3:31:26 PM UTC-7, Jens Alfke wrote: >> >> >> > On Jan 21, 2016, at 2:23 PM, Brendan Duddridge <[email protected]> >> wrote: >> > >> > But I've got a question about statuses. When I make a change and the >> push replicator gets called, I'm also noticing that the pull replicator is >> also getting called and the status is coming into the notification with a >> value of kCBLReplicationIdle. >> >> What exactly do you mean by “getting called” here? >> >> There’s always a bit of feedback when doing a push — when the server adds >> the pushed documents, its changes feed will wake up and send the client a >> notification of those documents. The client just sees that it already has >> those docs/revisions, so it doesn’t download them. But that may cause the >> puller to change its status from Idle to Busy for an instant. >> >> > The reason this is a problem for me right now is because when I receive >> a pull from the replicator, I refresh the screen to display the new data. >> >> Generally you shouldn’t use replication notifications to drive refresh of >> the UI. Instead, use database/document change notifications. >> >> For example, if you’re displaying data from a document on the current >> screen, register a CBLDocumentChangeNotification on that document while >> it’s visible, and update your display when notified. This is a general >> “reactive” programming practice that ensures your UI is up to date with the >> data, no matter how the data got changed. >> >> —Jens > > -- 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/0828c191-4afb-451a-a407-990646b987bb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
