Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional timeout before local changes get pushed #202

Closed
gr2m opened this issue Dec 5, 2013 · 3 comments
Closed

add optional timeout before local changes get pushed #202

gr2m opened this issue Dec 5, 2013 · 3 comments

Comments

@gr2m
Copy link
Member

gr2m commented Dec 5, 2013

this is a follow up for #180.

Latest Suggestion

hoodie.store.add('doc', properties, {debounce: true})

Meaning

we do not push this update to remote, until you stop making changes for a moment (with the debounce option).

Question 1

Any objections about adding such an option, and removing the default timeout?

Question 2

Is the meaning of debounce clear? Shall we call it differently?
related: http://underscorejs.org/#debounce

@gr2m
Copy link
Member Author

gr2m commented Dec 5, 2013

I agree that debounce might not be familiar. But its semantic is rather complex, too.
I'd like to start implementing 1. Changing the name of the option later is simple.

@janl
Copy link
Member

janl commented Mar 28, 2014

+1 for getting this going.

I also like the idea of being able to specify specific timeouts. A chat app should have zero latency for regular use, but if we also collect app metrics, they can be sent in bulk every minute. Would be nice to be able to have a timeout hierarchy:

  1. Hoodie default (hardcode 0 e.g.)
  2. hoodie instance default (var hoodie = new Hoodie(url, {idleTimeout: 3000}))
  3. hoodie.store default (hoodie.store('name, {idleTimeout: 2000}))
  4. storage operation timeout (hoodie.store.add('type', 'id', obj, {idleTimeout:60000}))

@gr2m gr2m changed the title add optional timeout before local changes get pushed optional add optional timeout before local changes get pushed May 7, 2016
@gr2m
Copy link
Member Author

gr2m commented May 7, 2016

closing in favor of hoodiehq/pouchdb-hoodie-api#111

@gr2m gr2m closed this as completed May 7, 2016
@gr2m gr2m removed the later label May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants