{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/comments/172291472","pull_request_review_id":101283989,"id":172291472,"diff_hunk":"@@ -0,0 +1,39 @@\n+#include <napi.h>\n+#include \"pi_est.h\"  // NOLINT(build/include)\n+#include \"async.h\"  // NOLINT(build/include)\n+\n+class PiWorker : public Napi::AsyncWorker {\n+ public:\n+  PiWorker(Napi::Function& callback, int points)\n+    : Napi::AsyncWorker(callback), points(points), estimate(0) {}\n+  ~PiWorker() {}\n+\n+  // Executed inside the worker-thread.\n+  // It is not safe to access V8, or V8 data structures\n+  // here, so everything we need for input and output\n+  // should go on `this`.\n+  void Execute () {\n+    estimate = Estimate(points);\n+  }\n+\n+  // Executed when the async work is complete\n+  // this function will be run inside the main event loop\n+  // so it is safe to use V8 again","path":"async_pi_estimate/node-addon-api/async.cc","position":21,"original_position":21,"commit_id":"6ee6492c03391de27c8281b9ea7ea3019b3e2ef1","original_commit_id":"6ee6492c03391de27c8281b9ea7ea3019b3e2ef1","user":{"login":"mhdawson","id":9373002,"avatar_url":"https://avatars3.githubusercontent.com/u/9373002?v=4","gravatar_id":"","url":"https://api.github.com/users/mhdawson","html_url":"https://github.com/mhdawson","followers_url":"https://api.github.com/users/mhdawson/followers","following_url":"https://api.github.com/users/mhdawson/following{/other_user}","gists_url":"https://api.github.com/users/mhdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/mhdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhdawson/subscriptions","organizations_url":"https://api.github.com/users/mhdawson/orgs","repos_url":"https://api.github.com/users/mhdawson/repos","events_url":"https://api.github.com/users/mhdawson/events{/privacy}","received_events_url":"https://api.github.com/users/mhdawson/received_events","type":"User","site_admin":false},"body":"probably don't want the reference to V8 here.","created_at":"2018-03-05T18:57:26Z","updated_at":"2018-03-05T18:57:26Z","html_url":"https://github.com/nodejs/abi-stable-node-addon-examples/pull/16#discussion_r172291472","pull_request_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/comments/172291472"},"html":{"href":"https://github.com/nodejs/abi-stable-node-addon-examples/pull/16#discussion_r172291472"},"pull_request":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16","id":172593232,"html_url":"https://github.com/nodejs/abi-stable-node-addon-examples/pull/16","diff_url":"https://github.com/nodejs/abi-stable-node-addon-examples/pull/16.diff","patch_url":"https://github.com/nodejs/abi-stable-node-addon-examples/pull/16.patch","issue_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/issues/16","number":16,"state":"open","locked":false,"title":"Porting asynchronous example from NAN repo","user":{"login":"NickNaso","id":387506,"avatar_url":"https://avatars2.githubusercontent.com/u/387506?v=4","gravatar_id":"","url":"https://api.github.com/users/NickNaso","html_url":"https://github.com/NickNaso","followers_url":"https://api.github.com/users/NickNaso/followers","following_url":"https://api.github.com/users/NickNaso/following{/other_user}","gists_url":"https://api.github.com/users/NickNaso/gists{/gist_id}","starred_url":"https://api.github.com/users/NickNaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickNaso/subscriptions","organizations_url":"https://api.github.com/users/NickNaso/orgs","repos_url":"https://api.github.com/users/NickNaso/repos","events_url":"https://api.github.com/users/NickNaso/events{/privacy}","received_events_url":"https://api.github.com/users/NickNaso/received_events","type":"User","site_admin":false},"body":"The original example is hosted here:\r\nhttps://github.com/nodejs/nan/tree/master/examples/async_pi_estimate\r\nRewrite all the logic using **node-addon-api**\r\nSee the following issue\r\nhttps://github.com/nodejs/abi-stable-node-addon-examples/issues/10","created_at":"2018-03-02T20:09:57Z","updated_at":"2018-03-05T18:57:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39b2f070e63946cb30919fd449cd36fabc140c77","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16/commits","review_comments_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16/comments","review_comment_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/issues/16/comments","statuses_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/statuses/6ee6492c03391de27c8281b9ea7ea3019b3e2ef1","head":{"label":"NickNaso:master","ref":"master","sha":"6ee6492c03391de27c8281b9ea7ea3019b3e2ef1","user":{"login":"NickNaso","id":387506,"avatar_url":"https://avatars2.githubusercontent.com/u/387506?v=4","gravatar_id":"","url":"https://api.github.com/users/NickNaso","html_url":"https://github.com/NickNaso","followers_url":"https://api.github.com/users/NickNaso/followers","following_url":"https://api.github.com/users/NickNaso/following{/other_user}","gists_url":"https://api.github.com/users/NickNaso/gists{/gist_id}","starred_url":"https://api.github.com/users/NickNaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickNaso/subscriptions","organizations_url":"https://api.github.com/users/NickNaso/orgs","repos_url":"https://api.github.com/users/NickNaso/repos","events_url":"https://api.github.com/users/NickNaso/events{/privacy}","received_events_url":"https://api.github.com/users/NickNaso/received_events","type":"User","site_admin":false},"repo":{"id":103190465,"name":"abi-stable-node-addon-examples","full_name":"NickNaso/abi-stable-node-addon-examples","owner":{"login":"NickNaso","id":387506,"avatar_url":"https://avatars2.githubusercontent.com/u/387506?v=4","gravatar_id":"","url":"https://api.github.com/users/NickNaso","html_url":"https://github.com/NickNaso","followers_url":"https://api.github.com/users/NickNaso/followers","following_url":"https://api.github.com/users/NickNaso/following{/other_user}","gists_url":"https://api.github.com/users/NickNaso/gists{/gist_id}","starred_url":"https://api.github.com/users/NickNaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickNaso/subscriptions","organizations_url":"https://api.github.com/users/NickNaso/orgs","repos_url":"https://api.github.com/users/NickNaso/repos","events_url":"https://api.github.com/users/NickNaso/events{/privacy}","received_events_url":"https://api.github.com/users/NickNaso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NickNaso/abi-stable-node-addon-examples","description":"Node Add-on Examples with PoC ABI stable API for native modules","fork":true,"url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples","forks_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/forks","keys_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/teams","hooks_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/hooks","issue_events_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/issues/events{/number}","events_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/events","assignees_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/assignees{/user}","branches_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/branches{/branch}","tags_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/tags","blobs_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/git/refs{/sha}","trees_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/statuses/{sha}","languages_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/languages","stargazers_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/stargazers","contributors_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/contributors","subscribers_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/subscribers","subscription_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/subscription","commits_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/commits{/sha}","git_commits_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/git/commits{/sha}","comments_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/comments{/number}","issue_comment_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/issues/comments{/number}","contents_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/contents/{+path}","compare_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/merges","archive_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/downloads","issues_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/issues{/number}","pulls_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/pulls{/number}","milestones_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/milestones{/number}","notifications_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/labels{/name}","releases_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/releases{/id}","deployments_url":"https://api.github.com/repos/NickNaso/abi-stable-node-addon-examples/deployments","created_at":"2017-09-11T21:34:53Z","updated_at":"2017-09-11T21:34:55Z","pushed_at":"2018-03-02T20:08:58Z","git_url":"git://github.com/NickNaso/abi-stable-node-addon-examples.git","ssh_url":"git@github.com:NickNaso/abi-stable-node-addon-examples.git","clone_url":"https://github.com/NickNaso/abi-stable-node-addon-examples.git","svn_url":"https://github.com/NickNaso/abi-stable-node-addon-examples","homepage":"","size":148,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"09885f5051d45f71ecd557b503c4013fe7462b93","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":67543905,"name":"abi-stable-node-addon-examples","full_name":"nodejs/abi-stable-node-addon-examples","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/abi-stable-node-addon-examples","description":"Node Add-on Examples with PoC ABI stable API for native modules","fork":false,"url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples","forks_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/forks","keys_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/teams","hooks_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/hooks","issue_events_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/events","assignees_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/tags","blobs_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/languages","stargazers_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/stargazers","contributors_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/contributors","subscribers_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/subscribers","subscription_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/subscription","commits_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/merges","archive_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/downloads","issues_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/deployments","created_at":"2016-09-06T20:24:54Z","updated_at":"2018-03-02T23:05:28Z","pushed_at":"2018-03-02T20:09:57Z","git_url":"git://github.com/nodejs/abi-stable-node-addon-examples.git","ssh_url":"git@github.com:nodejs/abi-stable-node-addon-examples.git","clone_url":"https://github.com/nodejs/abi-stable-node-addon-examples.git","svn_url":"https://github.com/nodejs/abi-stable-node-addon-examples","homepage":"","size":142,"stargazers_count":77,"watchers_count":77,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":19,"open_issues":5,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16"},"html":{"href":"https://github.com/nodejs/abi-stable-node-addon-examples/pull/16"},"issue":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/issues/16"},"comments":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/abi-stable-node-addon-examples/statuses/6ee6492c03391de27c8281b9ea7ea3019b3e2ef1"}},"author_association":"NONE"}}
{"actor":{"display_login":"mhdawson"}}