-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
Promised based interface #163
Comments
Hello @simme So far the synchronous approach has shown straightforward and efficient. Users who need asynchronous behaviors can write asynchronous wrappers around the synchronous primitives if they want. That's what Swift extensions are for, and my recommendation.
Yes it is a big job, and yes it has already been considered (and rejected). I think that it's easier said than done, for benefits I don't buy. Asynchronous methods can't easily express the Swift is evolving. Language support for asynchronous constructs is expected for Swift 4 or 5. Be patient, and polish your views of promises (or futures, or reactive programming, or channels, or whatever gives you the thrill) in the meantime. A synchronous GRDB blends into all of those patterns, and I'm quite happy with that. |
That makes a lot of sense and seems perfectly reasonable. I was looking through the issue history looking for questions re async but somehow missed that issue you linked to. I was mostly curious. Thank you for taking the time to answer thoroughly and thank you for a fantastic database framework! :) |
You're welcome @simme ! Happy GRDB ;-) |
Hello,
Have you considered adding a promise based interface? I realize that it might not be desirable to add additional dependencies to GRDB itself (a framework for promises) but maybe as an additional "add-on"?
It could be very nice when chaining operations. But mostly it would be a nice way of handling errors (IMO).
I realize it would be a pretty big job to wrap all methods to return promises and not something I expect to happen. Just curious if it's something you've even considered?
The text was updated successfully, but these errors were encountered: