Skip to content

Conversation

@jasongin
Copy link
Member

@jasongin jasongin commented Apr 3, 2017

Updates for pending changes in async APIs at nodejs/abi-stable-node#204, along with other recent changes.

  • Rename napi_work to napi_async_work
  • Async APIs all take an env parameter and return a napi_status
  • New napi_cancel_async_work() API
  • Track (a persistent reference to) an Error object for async work errors, rather than just an error message.
  • Error handling APIs all return a napi_status
  • Reference counts are unsigned

napi-inl.h Outdated
}

template <typename T>
inline int Reference<T>::Ref() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either the type is wrong or result needs a typecast before returning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed here and a few other places.

napi-inl.h Outdated
}

template <typename T>
inline int Reference<T>::Unref() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either the type is wrong or result needs a typecast before returning.

@jasongin jasongin requested a review from boingoing April 5, 2017 17:09
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@boingoing boingoing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasongin
Copy link
Member Author

jasongin commented Apr 5, 2017

@boingoing What is the plan for getting the async APIs into node?

Anyway, I don't see any point in holding this PR until those changes land, because the current code in this repo references the old N-API async functions that never landed in node. So updating this repo won't make things any worse.

@boingoing
Copy link

@boingoing What is the plan for getting the async APIs into node?

Prepping the PR for these changes as well as the one which changes napi_callback to return a napi_value. Both should be live today.

Agreed, no reason to hold on the changes in this PR here.

@jasongin jasongin merged commit d09ae4a into nodejs:master Apr 5, 2017
@jasongin jasongin deleted the async branch May 15, 2017 19:30
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

Successfully merging this pull request may close these issues.

4 participants