couchbaselabs / CouchCocoa

Objective-C API for CouchDB on iOS and Mac OS
http://couchbaselabs.github.com/CouchCocoa/docs/
218 stars 66 forks source link

Feature Request: Pausing a CouchLiveQuery #54

Open tobinharris opened 11 years ago

tobinharris commented 11 years ago

Discussed here on the TouchDB group.

I want my CouchLiveQuery to be paused when it's not the active screen in a navigation hierarchy, and then resume when the screen is loaded. This is to stop the query running and initiating re-indexing whilst the view is not visible. For my app, that re-indexing is a bit of a performance hit.

Jens suggested a simple solution - adding a .paused property to CouchLivequery that makes it ignore database changed notifications when .paused is set to YES.

T

ktraunmueller commented 11 years ago

I second that request. Temporarily pausing a CouchLiveQuery would be useful.

vkurchatkin commented 11 years ago

I think this can be achieved by setting database.trackChanges=NO. Although it will stop all other live queries, if any.

snej commented 11 years ago

FYI, I'm unlikely to implement this myself, because my time is going into Couchbase Lite and the Sync Gateway. I do recognize that some people use CouchCocoa along with CBL to talk directly to remote databases, though. It shouldn't be hard for someone else to implement.