Skip to content

tsfn: support direct calls to underlying napi_tsfn #580

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 5 commits into from
Nov 10, 2019

Conversation

KevinEady
Copy link
Contributor

Fixes: #556

@KevinEady
Copy link
Contributor Author

The implementation for this is based off previous napi meeting discussion, see #556 (comment)

@NickNaso NickNaso mentioned this pull request Oct 29, 2019
15 tasks
Copy link
Contributor Author

@KevinEady KevinEady left a comment

Choose a reason for hiding this comment

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

Like mentioned, this PR directly conflicts with #546 on the use of unique_ptr<napi_threadsafe_function> vs napi_threadsafe_function. It's a simple change to resolve, by changing *_tsfn to _tsfn ...

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

@mhdawson
Copy link
Member

Looks reasonable to me @gabrielschulhof can you take a look at as well?


napi_status Napi::ThreadSafeFunction::NonBlockingCall(void* data) const
```
- `data`: Data to pass to `call_js_cb` specified when creating the tsfn via
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `data`: Data to pass to `call_js_cb` specified when creating the tsfn via
- `data`: Data to pass to `call_js_cb` specified when creating the thread-safe function via

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After a nasty fight between 500s from GitHub's commit suggestion API and various force pushes, this is comment has been updated 👍

@KevinEady
Copy link
Contributor Author

Hi @mhdawson / @gabrielschulhof dunno what to do for this build failure:

https://travis-ci.com/nodejs/node-addon-api/jobs/253158482

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package g++-4.9
E: Couldn't find any package by glob 'g++-4.9'
E: Couldn't find any package by regex 'g++-4.9'
apt-get.diagnostics
apt-get install failed
The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install g++-4.9" failed and exited with 100 during .

@gabrielschulhof
Copy link
Contributor

@KevinEady I restarted the job.

@KevinEady
Copy link
Contributor Author

Hi @mhdawson just a reminder on landing this

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

LGTM, just found some nits in test :P.

@mhdawson
Copy link
Member

Landed as df75e08c2bae11b84ebbf5a1c6d54df8621b16fd

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.

ThreadSafeFunction(napi_threadsafe_function) works badly with BlockingCall()
4 participants