But the time it takes for the local Couchbase instance to come online
after resuming the app from the background is a real issue -- in my
fairly simple app it's taking a good 5-10 seconds.
That's good to know, but unfortunately I was already on the latest nightly (from 11/2). Do you think it will continue to improve?
Is there a way to query CouchBase quickly during the time it takes to start back up? That is, can my app either get notified via a callback when CouchBase is up and running again, or can it poll to see if it's back?
At least that way I can create a cache and pull from it (or create some sort of progress spinner) so it doesn't just hang.
So is it reasonable to expect that as Couchbase Mobile matures (say, within 6 months) there'll be a solution to this that provides near-instant availability after coming out of the background? Or is this always going to be an inherent issue to one degree or another?
Thanks.
--Dave
Resetting just the web module in Erlang shouldn't be tough. I'm really looking forward to all the tightening up we'll be able to do now that we've got basic stability (and more importantly a repeatable test process).
Chris
Chris, you mentioned that resetting the web module "shouldn't be tough" to fix? I'd gladly buy you a beer (or two) if you could encourage someone with the necessary skills to have a look the problem. ;)
I've (re)built the iOSCouchbase framework using the patched implementation files and it seems to work well. CouchDB is indeed immediately available again once the app re-enters the foreground. No more waiting 4-5 seconds before the user can read/write from the DB. All other CouchDB operations also seem to work fine (although I haven't tested replication yet).
Chris encouraged me by telling me what Erlang function to call (couch_httpd:stop). I got it working today, and it’s pretty much instantaneous. I also put in a check that only restarts on wake if the listener socket isn’t responding anymore. In the bit of testing I’ve done, the restart isn’t even necessary if the app hasn’t been evicted from RAM and the device hasn’t been put to sleep; so if you leave the app and go into another app for a few minutes and then come back, everything is still running when you return and nothing needs to be done.
--
Amos