Title: Add example/api to use ThreadSafeFunction with optional callback param · Issue #544 · nodejs/node-addon-api · GitHub
Open Graph Title: Add example/api to use ThreadSafeFunction with optional callback param · Issue #544 · nodejs/node-addon-api
X Title: Add example/api to use ThreadSafeFunction with optional callback param · Issue #544 · nodejs/node-addon-api
Description: Since nodejs/node#27791 has been landed, there might be some use cases on node-addon-api to use Napi::ThreadSafeFunction with optional callback parameter. Approaches might be adding an example of how to use existing Napi::ThreadSafeFunct...
Open Graph Description: Since nodejs/node#27791 has been landed, there might be some use cases on node-addon-api to use Napi::ThreadSafeFunction with optional callback parameter. Approaches might be adding an example of h...
X Description: Since nodejs/node#27791 has been landed, there might be some use cases on node-addon-api to use Napi::ThreadSafeFunction with optional callback parameter. Approaches might be adding an example of h...
Opengraph URL: https://github.com/nodejs/node-addon-api/issues/544
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add example/api to use ThreadSafeFunction with optional callback param","articleBody":"Since https://github.com/nodejs/node/pull/27791 has been landed, there might be some use cases on node-addon-api to use `Napi::ThreadSafeFunction` with optional callback parameter.\r\n\r\nApproaches might be adding an example of how to use existing `Napi::ThreadSafeFunction::New` like:\r\n\r\n```c++\r\nFunction callback;\r\nauto tsfn = ThreadSafeFunction::New(env, callback, resource_name, 1, 1);\r\n```\r\n\r\n(is there a more intuitive one?)\r\n\r\nOr add a new API which make the callback omitted:\r\n```c++\r\nauto tsfn = ThreadSafeFunction::New(env, resource_name, 1, 1);\r\n```\r\n","author":{"url":"https://github.com/legendecas","@type":"Person","name":"legendecas"},"datePublished":"2019-09-17T16:09:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/544/node-addon-api/issues/544"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dbcbb8c8-ace2-6691-95d0-a878266835f3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C88C:1D90CC:175AA2C:1FCE48A:6A4F0A3B |
| html-safe-nonce | e5fb5a8b10c3db65380f18b7e87ace0fdae298aeb23cb48171124943db7b2c12 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODhDOjFEOTBDQzoxNzVBQTJDOjFGQ0U0OEE6NkE0RjBBM0IiLCJ2aXNpdG9yX2lkIjoiMzM3MjA0MDU3MDMyMzAxMjE1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8b7d1f3b2cce86f0e5d33bbc2e08fc1d643cb005a57c6ff7ca1df5b34dbd115a |
| hovercard-subject-tag | issue:494718169 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node-addon-api/544/issue_layout |
| twitter:image | https://opengraph.githubassets.com/63d24eff6e6413135c184c0db87a04cb254e95674ae8d1ba89a06dab82c7c6fb/nodejs/node-addon-api/issues/544 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/63d24eff6e6413135c184c0db87a04cb254e95674ae8d1ba89a06dab82c7c6fb/nodejs/node-addon-api/issues/544 |
| og:image:alt | Since nodejs/node#27791 has been landed, there might be some use cases on node-addon-api to use Napi::ThreadSafeFunction with optional callback parameter. Approaches might be adding an example of h... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | legendecas |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node-addon-api git https://github.com/nodejs/node-addon-api.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 81384578 |
| octolytics-dimension-repository_nwo | nodejs/node-addon-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81384578 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node-addon-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width