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

changes / replicate should return a complete promise? #1521

Closed
daleharvey opened this issue Feb 26, 2014 · 6 comments
Closed

changes / replicate should return a complete promise? #1521

daleharvey opened this issue Feb 26, 2014 · 6 comments

Comments

@daleharvey
Copy link
Member

No description provided.

@calvinmetcalf
Copy link
Member

+10000

@daleharvey
Copy link
Member Author

Im gonna say this is a reasonably clear patch, goodfirstpatching

@calvinmetcalf
Copy link
Member

A note to the fixer that you can't just use toPromise and you have to deal
with canceling.
On Feb 27, 2014 5:06 AM, "Dale Harvey" [email protected] wrote:

Im gonna say this is a reasonably clear patch, goodfirstpatching

Reply to this email directly or view it on GitHubhttps://github.com/daleharvey/pouchdb/issues/1521#issuecomment-36227226
.

@ig3
Copy link

ig3 commented Mar 2, 2014

Looking at this I see that Cancellation/A+, which bluebird seems to be following, suggests cancellation should reject a promise rather than resolve it. Recent changes to PouchDB make cancellation of changes more reliable, but with no error to the callback.

Perhaps now, as complete promises are being introduced, this should be revisited and cancellation should return an error to callbacks and rejection of the promise.

I am working on a change to changes in adapter.js to return a complete promise and, at the moment to return an error on cancellation, but it is easy enough to go either way with the return.

Might a change to returning an error/rejection on cancel be accepted?

@calvinmetcalf
Copy link
Member

I think the main focus should be on making it a readable stream first, and then promise second, there is no reason it can't be both but a stream is going to be the more natural way to get data, the main hurdle there is going to be pausing the stream which is currently impossible to do.

@calvinmetcalf
Copy link
Member

this is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants