Jinho Bang romandev Samsung Electronics Suwon, Korea https://romandev.github.io Open Web Platform Developer

Pull request review commentnodejs/node-addon-api

Implement ThreadSafeFunction class

 inline void AsyncWorker::OnWorkComplete(   delete self; } +////////////////////////////////////////////////////////////////////////////////+// ThreadSafeFunction class+////////////////////////////////////////////////////////////////////////////////++// static+template <typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, static_cast<void*>(nullptr));+}++// static+template <typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount) {+  return New(env, callback, resource, resourceName, maxQueueSize,+             initialThreadCount, static_cast<void*>(nullptr));+}++// static+template <typename DataType, typename Finalizer, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, data, finalizeCallback);+}++// static+template <typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  Context* context) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, context);+}++// static+template <typename DataType, typename Finalizer,+              typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback,+                                                  Context* context) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, data, finalizeCallback, context);+}++// static+template <typename DataType, typename Finalizer, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback) {+  static_assert(details::can_make_string<ResourceString>::value+      || std::is_convertible<ResourceString, napi_value>::value,+      "Resource name should be string convertible type");++  napi_threadsafe_function tsFunctionValue;+  auto* finalizeData = new details::FinalizeData<DataType, Finalizer>({+      finalizeCallback, nullptr });+  napi_status status = napi_create_threadsafe_function(env, callback, resource,+      Value::From(env, resourceName), maxQueueSize, initialThreadCount, data,+      details::FinalizeData<DataType, Finalizer>::Wrapper,+      finalizeData, CallJS, &tsFunctionValue);+  if (status != napi_ok) {+    delete finalizeData;+    NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction());+  }++  return ThreadSafeFunction(env, tsFunctionValue);+}++// static+template <typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  Context* context) {+  static_assert(details::can_make_string<ResourceString>::value+      || std::is_convertible<ResourceString, napi_value>::value,+      "Resource name should be string convertible type");++  napi_threadsafe_function tsFunctionValue;+  napi_status status = napi_create_threadsafe_function(env, callback, resource,+      Value::From(env, resourceName), maxQueueSize, initialThreadCount, nullptr,+      nullptr, context, CallJS, &tsFunctionValue);+  if (status != napi_ok) {+    NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction());+  }++  return ThreadSafeFunction(env, tsFunctionValue);+}++// static+template <typename DataType, typename Finalizer,+          typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback,+                                                  Context* context) {+  static_assert(details::can_make_string<ResourceString>::value+      || std::is_convertible<ResourceString, napi_value>::value,+      "Resource name should be string convertible type");++  napi_threadsafe_function tsFunctionValue;+  auto* finalizeData = new details::FinalizeData<DataType, Finalizer>({+      finalizeCallback, context });+  napi_status status = napi_create_threadsafe_function(env, callback, resource,+      Value::From(env, resourceName), maxQueueSize, initialThreadCount, data,+      details::FinalizeData<DataType, Finalizer, Context>::WrapperWithHint,+      finalizeData, CallJS, &tsFunctionValue);+  if (status != napi_ok) {+    delete finalizeData;+    NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction());+  }++  return ThreadSafeFunction(env, tsFunctionValue);+}++inline ThreadSafeFunction::Status ThreadSafeFunction::BlockingCall() const {+  return CallInternal(nullptr, napi_tsfn_blocking);+}++template <typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::BlockingCall(+    Callback callback) const {+  return CallInternal(new CallbackWrapper(callback), napi_tsfn_blocking);+}++template <typename DataType, typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::BlockingCall(+    DataType* data, Callback callback) const {+  auto wrapper = [data, callback](Env env, Function jsCallback) {+    callback(env, jsCallback, data);+  };+  return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_blocking);+}++inline ThreadSafeFunction::Status ThreadSafeFunction::NonBlockingCall() const {+  return CallInternal(nullptr, napi_tsfn_nonblocking);+}++template <typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::NonBlockingCall(+    Callback callback) const {+  return CallInternal(new CallbackWrapper(callback), napi_tsfn_nonblocking);+}++template <typename DataType, typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::NonBlockingCall(+    DataType* data, Callback callback) const {+  auto wrapper = [data, callback](Env env, Function jsCallback) {+    callback(env, jsCallback, data);+  };+  return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_nonblocking);+}++inline bool ThreadSafeFunction::Acquire() const {+  return !IsAborted() && napi_acquire_threadsafe_function(+      _tsFunctionValue) == napi_ok;+}++inline bool ThreadSafeFunction::Release() {+  return !IsAborted() && napi_release_threadsafe_function(+      _tsFunctionValue, napi_tsfn_release) == napi_ok;+}++inline bool ThreadSafeFunction::Abort() {+  if (IsAborted()) {+    return false;+  }++  napi_status status = napi_release_threadsafe_function(+      _tsFunctionValue, napi_tsfn_abort);++  _tsFunctionValue = nullptr;+  _env = nullptr;++  return status == napi_ok;

@gabrielschulhof Gentle ping

romandev

comment created time in 7 days

pull request commentnodejs/node-addon-api

Implement ThreadSafeFunction class

@extmchristensen Sorry for belated response.

Will this change allow calls into JS from another 3rd party thread similar to the napi-thread-safe-callback module?

Yes, it is. this patch wraps the N-APIs for thread safe function calls. https://nodejs.org/dist/latest-v11.x/docs/api/n-api.html#n_api_asynchronous_thread_safe_function_calls

romandev

comment created time in 7 days

pull request commentnodejs/node-addon-api

Implement ThreadSafeFunction class

@KevinEady, I implemented my idea for GetContext() without class template into latest patch. Could you please review the patch? If you mind my idea, I'll get rid of it from my patch. Thank you.

romandev

comment created time in 7 days

push eventromandev/node-addon-api

Jinho Bang

commit sha 41da82e9df4c56a833f5e654b9ec82b13b205bdd

Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function features. FYI, the test files that included in this PR have come from Node.js repo[1]. They've been rewritten based on C++ and node-addon-api. Fixes #312. [1] https://github.com/nodejs/node/tree/master/test/node-api/test_threadsafe_function

view details

push time in 7 days

push eventromandev/node-addon-api

Ryuichi Okumura

commit sha 72b1975cfffbc55a04c64047467d7dd0bfa2934e

doc: fix links to the Property Descriptor docs PR-URL: https://github.com/nodejs/node-addon-api/pull/458 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>

view details

Gabriel Schulhof

commit sha b0f6b601aaa0a8f488fec2b4f09e0f3f65f4a241

src: add AsyncWorker destruction suppression Add method `SuppressDestruct()` to `AsyncWorker`, which will cause an instance of the class to remain allocated even after the `OnOK` callback fires. Such an instance must be explicitly `delete`-ed from user code. Re: https://github.com/nodejs/node-addon-api/issues/231 Re: https://github.com/nodejs/abi-stable-node/issues/353 PR-URL: https://github.com/nodejs/node-addon-api/pull/407 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>

view details

Bill Gallafent

commit sha 1ed7ad87696a54fab9edc91e329cc9cd7ef842b9

doc: correct return type of Int32Value to int32_t It currently reads uint32_t, which would be very strange, and is also untrue (I checked napi.h) ;) PR-URL: https://github.com/nodejs/node-addon-api/pull/459 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>

view details

Nicola Del Gobbo

commit sha 83b41c2fe46a7693aba291ffa740932a9f142be2

Document adding -fvisibility=hidden flag for macOS users * -fvisibility=hidden flag for macOS user Added section to remember the macOS user to add the `-fvisibility=hidden` flag. PR-URL: https://github.com/nodejs/node-addon-api/pull/460 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

NickNaso

commit sha c12c42519c108b859c7d9f3a3ebb902f948eabd6

Prepare release 1.6.3

view details

Gabriel "_|Nix|_" Schulhof

commit sha 36863f087b1f879184ae64ebfef9c19e07c4ae0d

doc: refer to TypedArray and ArrayBuffer from Array Add a blurb to the `Napi::Array` documentation that refers readers to `Napi::TypedArray` and `Napi::ArrayBuffer` for using arrays with large amounts of data. PR-URL: https://github.com/nodejs/node-addon-api/pull/465 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>

view details

Jinho Bang

commit sha 2d549684ddd13b1c6ea14f0ccaff810e35c0c249

Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function features. FYI, the test files that included in this PR have come from Node.js repo[1]. They've been rewritten based on C++ and node-addon-api. Fixes #312. [1] https://github.com/nodejs/node/tree/master/test/node-api/test_threadsafe_function

view details

push time in 10 days

startedSamsung/Castanets

started time in 16 days

startedgdgsuwon/solocoding2019_base

started time in 21 days

pull request commentw3c/payment-request

Set [[waitForUpdate]] to true on dispatch of payerdetailchange

https://bugs.chromium.org/p/chromium/issues/detail?id=947938

marcoscaceres

comment created time in 23 days

pull request commentnodejs/node-addon-api

Implement ThreadSafeFunction class

@KevinEady If you're already implementing GetContext(), I'll leave a FIXME comment and then you can land your patch in follow-up PR. If you'd like to include the GetContext() implementation in this patch, I'll continue the work. Basically, I wanted to implement GetContext without explicit template. (But I'm not sure if it is possible or not.)

romandev

comment created time in a month

Pull request review commentnodejs/node-addon-api

Implement ThreadSafeFunction class

 inline void AsyncWorker::OnWorkComplete(   delete self; } +////////////////////////////////////////////////////////////////////////////////+// ThreadSafeFunction class+////////////////////////////////////////////////////////////////////////////////++// static+template <typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, static_cast<void*>(nullptr));+}++// static+template <typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount) {+  return New(env, callback, resource, resourceName, maxQueueSize,+             initialThreadCount, static_cast<void*>(nullptr));+}++// static+template <typename DataType, typename Finalizer, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, data, finalizeCallback);+}++// static+template <typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  Context* context) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, context);+}++// static+template <typename DataType, typename Finalizer,+              typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback,+                                                  Context* context) {+  return New(env, callback, Object(), resourceName, maxQueueSize,+             initialThreadCount, data, finalizeCallback, context);+}++// static+template <typename DataType, typename Finalizer, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback) {+  static_assert(details::can_make_string<ResourceString>::value+      || std::is_convertible<ResourceString, napi_value>::value,+      "Resource name should be string convertible type");++  napi_threadsafe_function tsFunctionValue;+  auto* finalizeData = new details::FinalizeData<DataType, Finalizer>({+      finalizeCallback, nullptr });+  napi_status status = napi_create_threadsafe_function(env, callback, resource,+      Value::From(env, resourceName), maxQueueSize, initialThreadCount, data,+      details::FinalizeData<DataType, Finalizer>::Wrapper,+      finalizeData, CallJS, &tsFunctionValue);+  if (status != napi_ok) {+    delete finalizeData;+    NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction());+  }++  return ThreadSafeFunction(env, tsFunctionValue);+}++// static+template <typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  Context* context) {+  static_assert(details::can_make_string<ResourceString>::value+      || std::is_convertible<ResourceString, napi_value>::value,+      "Resource name should be string convertible type");++  napi_threadsafe_function tsFunctionValue;+  napi_status status = napi_create_threadsafe_function(env, callback, resource,+      Value::From(env, resourceName), maxQueueSize, initialThreadCount, nullptr,+      nullptr, context, CallJS, &tsFunctionValue);+  if (status != napi_ok) {+    NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction());+  }++  return ThreadSafeFunction(env, tsFunctionValue);+}++// static+template <typename DataType, typename Finalizer,+          typename Context, typename ResourceString>+inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env,+                                                  const Function& callback,+                                                  const Object& resource,+                                                  ResourceString resourceName,+                                                  size_t maxQueueSize,+                                                  size_t initialThreadCount,+                                                  DataType* data,+                                                  Finalizer finalizeCallback,+                                                  Context* context) {+  static_assert(details::can_make_string<ResourceString>::value+      || std::is_convertible<ResourceString, napi_value>::value,+      "Resource name should be string convertible type");++  napi_threadsafe_function tsFunctionValue;+  auto* finalizeData = new details::FinalizeData<DataType, Finalizer>({+      finalizeCallback, context });+  napi_status status = napi_create_threadsafe_function(env, callback, resource,+      Value::From(env, resourceName), maxQueueSize, initialThreadCount, data,+      details::FinalizeData<DataType, Finalizer, Context>::WrapperWithHint,+      finalizeData, CallJS, &tsFunctionValue);+  if (status != napi_ok) {+    delete finalizeData;+    NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction());+  }++  return ThreadSafeFunction(env, tsFunctionValue);+}++inline ThreadSafeFunction::Status ThreadSafeFunction::BlockingCall() const {+  return CallInternal(nullptr, napi_tsfn_blocking);+}++template <typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::BlockingCall(+    Callback callback) const {+  return CallInternal(new CallbackWrapper(callback), napi_tsfn_blocking);+}++template <typename DataType, typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::BlockingCall(+    DataType* data, Callback callback) const {+  auto wrapper = [data, callback](Env env, Function jsCallback) {+    callback(env, jsCallback, data);+  };+  return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_blocking);+}++inline ThreadSafeFunction::Status ThreadSafeFunction::NonBlockingCall() const {+  return CallInternal(nullptr, napi_tsfn_nonblocking);+}++template <typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::NonBlockingCall(+    Callback callback) const {+  return CallInternal(new CallbackWrapper(callback), napi_tsfn_nonblocking);+}++template <typename DataType, typename Callback>+inline ThreadSafeFunction::Status ThreadSafeFunction::NonBlockingCall(+    DataType* data, Callback callback) const {+  auto wrapper = [data, callback](Env env, Function jsCallback) {+    callback(env, jsCallback, data);+  };+  return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_nonblocking);+}++inline bool ThreadSafeFunction::Acquire() const {+  return !IsAborted() && napi_acquire_threadsafe_function(+      _tsFunctionValue) == napi_ok;+}++inline bool ThreadSafeFunction::Release() {+  return !IsAborted() && napi_release_threadsafe_function(+      _tsFunctionValue, napi_tsfn_release) == napi_ok;+}++inline bool ThreadSafeFunction::Abort() {+  if (IsAborted()) {+    return false;+  }++  napi_status status = napi_release_threadsafe_function(+      _tsFunctionValue, napi_tsfn_abort);++  _tsFunctionValue = nullptr;+  _env = nullptr;++  return status == napi_ok;

Sorry, I don't understand what you want exactly. Do you want this function to return three status instead of boolean? (like napi_release_threadsafe_function) If so, could you please explain the use cases in more details?

romandev

comment created time in a month

push eventromandev/kosscontributhon2018

Jinho Bang

commit sha 5369fe115700d9aa289c1f3efcc0a5e20d89f217

GDG Suwon Dashboard

view details

push time in a month

fork romandev/kosscontributhon2018

2018 컨트리뷰톤 실시간 현황 확인 및 행사 진행 페이지 입니다.

https://contributhon.herokuapp.com/

fork in a month

push eventromandev/node-addon-api

Jinho Bang

commit sha 5fc684df2e41d23a441a8a3f22511b1ca0d1a426

Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function features. FYI, the test files that included in this PR have come from Node.js repo[1]. They've been rewritten based on C++ and node-addon-api. Fixes #312. [1] https://github.com/nodejs/node/tree/master/test/node-api/test_threadsafe_function

view details

push time in a month

push eventromandev/node-addon-api

Jinho Bang

commit sha f04ba109fba269126f696d9a8b45506bf75388fc

Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function features. FYI, the test files that included in this PR have come from Node.js repo[1]. They've been rewritten based on C++ and node-addon-api. Fixes #312. [1] https://github.com/nodejs/node/tree/master/test/node-api/test_threadsafe_function

view details

push time in a month

pull request commentnodejs/node-addon-api

Implement ThreadSafeFunction class

@gabrielschulhof, @mhdawson PTAL (If you don't mind, I'd like to push docs update into separated PR because this PR is enough large)

romandev

comment created time in 2 months

push eventromandev/node-addon-api

Jinho Bang

commit sha 78b68bea4845413b9d06c584f8e21aa75e377058

Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function features. FYI, the test files that included in this PR have come from Node.js repo[1]. They've been rewritten based on C++ and node-addon-api. Fixes #312. [1] https://github.com/nodejs/node/tree/master/test/node-api/test_threadsafe_function

view details

push time in 2 months

push eventromandev/node-addon-api

Jinho Bang

commit sha a78aff805825437835e87c932961ed15d5ebfb08

Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function features. FYI, the test files that included in this PR have come from Node.js repo[1]. They've been rewritten based on C++ and node-addon-api. Fixes #312. [1] https://github.com/nodejs/node/tree/master/test/node-api/test_threadsafe_function

view details

push time in 2 months

push eventromandev/node-addon-api

Abhishek Kumar Singh

commit sha ad6f569f85a6794f655df34cf03755ca25c7d40a

doc: dix typo Fixes type at line 27 of doc/number.md. PR-URL: https://github.com/nodejs/node-addon-api/pull/435 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Jake Barnes

commit sha 0bc7987806454d8db6ffec46ad9262f0446df4a2

doc: fix references to Weak and Persistent PR-URL: https://github.com/nodejs/node-addon-api/pull/428 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>

view details

Sam Roberts

commit sha b409a2f9877ceeed8f09b783d9bd5e6f45c1baea

package: add npm search keywords PR-URL: https://github.com/nodejs/node-addon-api/pull/452 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Gabriel Schulhof

commit sha fcf173d2a177cca2cc5a722117fe374513d7d1fb

src: expose macros that throw errors Macros `NAPI_THROW`, `NAPI_THROW_IF_FAILED`, and `NAPI_FATAL_IF_FAILED` have so far been used only in the implementation of node-addon-api. Nevertheless, they are useful in cases where direct N-API calls must be interspersed between normal node-addon-api usage. The greatest value they provide is that they convert non-`napi_ok` `napi_status` values into errors that can be thrown, and that they throw the errors respecting whether C++ exceptions are enabled or not. PR-URL: https://github.com/nodejs/node-addon-api/pull/448 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>

view details

Bernardo Heynemann

commit sha 7b87e0b9993942d4404c0a2a209ee28423790914

doc: update number.md Update docs to be consistent with how thing are described in other sections. PR-URL: https://github.com/nodejs/node-addon-api/pull/436 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Bruce A. MacNaughton

commit sha c629553cd7b08ea9e56a55176583219ee19a8a86

doc: minor doc corrections and clarifications - class_property_descriptor - Contructor => Constructor - object - returns *undefined* not NULL if key doesn't exist - object_wrap - Contructor => Constructor - property_descriptor - environemnt => environment PR-URL: https://github.com/nodejs/node-addon-api/pull/426 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>

view details

Jinho Bang

commit sha fcfc612728fad0533aaa63f5aaad25bae712eeb3

build: new build targets for debug purposes In this project, we can use the following command to test examples. $ npm test It might be very inefficient, especially, if the number of files increases. So, this patch introduces new build targets for debugging purpose as follows: $ npm run-script dev # Build with --debug option $ npm run-script dev:incremental # Incremental dev build This idea comes from @DaAitch. PR-URL: https://github.com/nodejs/node-addon-api/pull/186 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Jinho Bang

commit sha cf15f53fd09bad3aa9e06964f5caed5b1b74916c

Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function features. FYI, the test files that included in this PR have come from Node.js repo[1]. They've been rewritten based on C++ and node-addon-api. Fixes #312. [1] https://github.com/nodejs/node/tree/master/test/node-api/test_threadsafe_function

view details

push time in 2 months

PR opened nodejs/node-addon-api

[WIP] Implement ThreadSafeFunction class

This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function*.

Fixes #312.

+189 -1

0 comment

8 changed files

pr created time in 3 months

push eventromandev/node-addon-api

NickNaso

commit sha 4852238b9d35fed9c5b6a574f85b93b49d196052

Added references to changelog maker tool and other minor fixes to explain better the process.

view details

NickNaso

commit sha f3e01db8fabfa0f3ae81c4158f91fadf6a54c603

Removed 4 and 9 from Node.js version to test on CI

view details

Philipp Renoth

commit sha 0b4027575216c3ceb5839d4699556b9a27814f88

src: fix noexcept control flow issues - adapt `NAPI_THROW`, create `NAPI_THROW_VOID`: either throw or return, never continue - fix `Error::ThrowAsJavaScriptException`: if `napi_throw` fails, either explicitly throw or create fatal error Fixes: https://github.com/nodejs/node-addon-api/issues/419 PR-URL: https://github.com/nodejs/node-addon-api/pull/420 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Philipp Renoth

commit sha 91eaa6f4cb970894ccbf7d9a0efb515d451191f2

src: fix callbackData leaks on error napi status PR-URL: https://github.com/nodejs/node-addon-api/pull/417 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Philipp Renoth

commit sha 020ac4a628debf7ce44429fd22c5bdff7c88a50a

src: make `Object::GetPropertyNames()` const Fixes: https://github.com/nodejs/node-addon-api/issues/380 PR-URL: https://github.com/nodejs/node-addon-api/pull/415 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Philipp Renoth

commit sha fa49d6841616c12d2602a5454599fc6e8783d0cc

doc: fix some `Finalizer` signatures - External::New - ArrayBuffer::New - Buffer::New PR-URL: https://github.com/nodejs/node-addon-api/pull/414 Fixes: https://github.com/nodejs/node-addon-api/issues/383 Refs: https://github.com/nodejs/node-addon-api/pull/384 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Nicola Del Gobbo

commit sha 44f0695533327a12548a5015c444a3a5d731bb5c

Merge pull request #394 from NickNaso/create_release Added references to changelog maker tool and other minor fixes

view details

Jim Schlight

commit sha 48220335b09081d9ae7ecba407fa40b889c85a7d

Membership review update

view details

Jim Schlight

commit sha 4921e74d83b00c96ae55609f88443f893f192240

Rearranges names to be alphabetical

view details

Jim Schlight

commit sha 28df833a497efd4c690f4e81a3a77db4399cb9a4

Merge pull request #441 from jschlight/master Membership review update

view details

Jinho Bang

commit sha 3d02ab3eccb8f6dad784f0491fbbf0e0a55bfc0c

[WIP] Implement ThreadSafeFunction class This PR is implementing ThreadSafeFunction class wraps napi_threadsafe_function*. Fixes #312.

view details

push time in 3 months

create barnchromandev/node-addon-api

branch : threadfunction

created branch time in 3 months

issue commentnodejs/node-addon-api

Support for Asynchronous Thread-safe Function Calls

@DaAitch Okay, thank you for explanation. I was lacking in understanding. I'll send a PR. Please review it when you have a spare time.

srirajpaul

comment created time in 3 months

issue commentnodejs/node-addon-api

How to have a background thread call back to JS multiple times?

@twoi, I think this issue is duplicated with https://github.com/nodejs/node-addon-api/issues/312

So the *_threadsafe_function isn't even part of the N-API included in the latest node-addon-api, which would mean I have to ditch node-addon-api and do everything with lower level N-API?

Yes, for now.

twoi

comment created time in 3 months

more