On Sunday, January 4, 2015 8:21:49 PM UTC-3, Jens Alfke wrote: > > > On Jan 3, 2015, at 9:43 PM, Vinay Bhinde <[email protected] <javascript:>> > wrote: > > Also is there any way to know if a particular replication has been > completed ? > > > For a non-continuous replication, the POST to _replicate won't return > until the replication completes. (This behavior changed; it didn't use to > be this way in 1.0.) > For a continuous replication, GET _active_tasks and see if its "status" > property is "Idle". > > ie Suppose if i have 10 docs in SG and i use my app with on a new device > with continuous replication on then my _changes will fire 10 times > initially and it will call my UI update function 10 times which causes > issues. > > > You can buffer up the changes, i.e. don't redraw immediately but wait like > ΒΌ sec in case there are more notifications. > > In general it's best to let your UI updates be driven by _changes, as I've > said before. > > Also i checked the native api docs > <http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/replication/index.html> > and > I found you provide status property to check if the replication has been > completed. It says continuous replication never stops. So how do I wait for > a continuous replication to complete before calling my function in cordova > app ? > > > See above. > > Do I need to query _active_tasks continuously for the status ? If yes then > how ? > > > Um, start a timer and GET _active_tasks once a second? There's also a > "?continuous=true" parameter you can add to it that acts like the > continuous _changes feed. > > (Hey, people-who-know-more-about-PhoneGap-than-I-do: Don't we have a > sample app that shows this kind of stuff?) >
There're two applications using phonegap and couchbase, but the synchronization process is not clear enough. It'd be great to know how the sync flow should be. -- 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/6303d8d7-b89f-452c-b487-7b95d9bfcdf7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
