Skip to content

Return promises and remove callback arguments #476

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

Merged
merged 13 commits into from
Aug 27, 2019

Conversation

ali-ince
Copy link
Contributor

@ali-ince ali-ince commented Aug 21, 2019

This PR modifies existing API's to return Promises instead of the previous callback mechanism.

  1. Driver.close() now returns Promise<void>.
  2. Transaction.commit() and Transaction.rollback() now returns Promise<void> rather than the internal Result object which holds more and confusing information not applicable to the underlying commit/rollback operation (resolves Commit() return values do not have actions taken #260).
  3. Internal Pool implementation now stores it's closed state and now is able to return errors if it's asked for a new connection (resolves Session and driver not closing; can still post queries @1.7.2 #442).
  4. Refactored stub tests so that they run faster and are now compatible with latest promise returning functions.

Based on #445.

@ali-ince ali-ince requested a review from zhenlineo August 21, 2019 16:12
@ali-ince ali-ince merged commit 07ec4cb into neo4j:2.0 Aug 27, 2019
@ali-ince ali-ince deleted the 2.0-return-promise branch August 27, 2019 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant