Skip to content
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

Add threadsafe function example #127

Merged
merged 2 commits into from
Mar 2, 2020

Conversation

KevinEady
Copy link
Contributor

This is a migration of the example provided on The N-API Resource.

Running npm i && node ./ in the example folder successfully installs and runs the addon, producing the following output:

2020-02-25T19:24:00.072Z 0
2020-02-25T19:24:00.276Z 1
2020-02-25T19:24:00.478Z 2
2020-02-25T19:24:00.679Z 3
2020-02-25T19:24:00.879Z 4
2020-02-25T19:24:01.085Z 5
2020-02-25T19:24:01.287Z 6
2020-02-25T19:24:01.487Z 7
2020-02-25T19:24:01.693Z 8
2020-02-25T19:24:01.896Z 9
true

Copy link
Contributor

@jschlight jschlight left a comment

Choose a reason for hiding this comment

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

Other than the one comment below LGTM.

"bindings": "*"
},
"engines": {
"node": ">= 10.6.0"
Copy link
Contributor

@jschlight jschlight Feb 26, 2020

Choose a reason for hiding this comment

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

This should probably be the version of Node where threadsafe functions were added or came out of experimental. I'm not sure what version that was. On my system it fails on v10.10.0 but works with v10.15.1. N-API Version Matrix

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 after @jschlight comment is addressed

@KevinEady
Copy link
Contributor Author

Hey @jschlight / @mhdawson , this should be resolved now

@mhdawson mhdawson merged commit 155b1cf into nodejs:master Mar 2, 2020
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