{"action":"created","comment":{"url":"https://api.github.com/repos/pelias/fences-slicer/pulls/comments/28427452","id":28427452,"diff_hunk":"@@ -0,0 +1,34 @@\n+var geojsonSlicer = require('./geojsonSlicer');\n+\n+/**\n+ * This childProcess responds to a start message and will\n+ * slice an input file into specified regions\n+ *\n+ * payload is expected to have the following properties:\n+ *\n+ *  {string} type 'start'\n+ *  {object} data\n+ *  {string} data.inputFile\n+ *  {[]}     data.regions [{outputFile: {string}, box: [lat1,lon1,lat2,lon1]}]\n+ */\n+process.on('message', function (payload) {\n+  if (payload.type === 'start') {\n+    slice(payload.data.inputFile, payload.data.regions);\n+  }\n+});\n+\n+/**\n+ * Execute slicer function with given params\n+ *\n+ * @param {string} inputFile\n+ * @param {[]} regions\n+ */\n+function slice(inputFile, regions) {\n+  geojsonSlicer.extractRegions(inputFile, regions, function () {\n+    process.send({\n+      type: 'done',\n+      data: { inputFile: inputFile }\n+    });\n+    process.nextTick(process.exit.bind(null, 0));","path":"src/childProcess.js","position":32,"original_position":32,"commit_id":"c7848a8609e1029b78f985effb39ec9137a86fea","original_commit_id":"c7848a8609e1029b78f985effb39ec9137a86fea","user":{"login":"sevko","id":4467604,"avatar_url":"https://avatars.githubusercontent.com/u/4467604?v=3","gravatar_id":"","url":"https://api.github.com/users/sevko","html_url":"https://github.com/sevko","followers_url":"https://api.github.com/users/sevko/followers","following_url":"https://api.github.com/users/sevko/following{/other_user}","gists_url":"https://api.github.com/users/sevko/gists{/gist_id}","starred_url":"https://api.github.com/users/sevko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevko/subscriptions","organizations_url":"https://api.github.com/users/sevko/orgs","repos_url":"https://api.github.com/users/sevko/repos","events_url":"https://api.github.com/users/sevko/events{/privacy}","received_events_url":"https://api.github.com/users/sevko/received_events","type":"User","site_admin":false},"body":"Passing `process.exit` on its own might work.","created_at":"2015-04-15T15:01:36Z","updated_at":"2015-04-15T15:01:36Z","html_url":"https://github.com/pelias/fences-slicer/pull/5#discussion_r28427452","pull_request_url":"https://api.github.com/repos/pelias/fences-slicer/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/pelias/fences-slicer/pulls/comments/28427452"},"html":{"href":"https://github.com/pelias/fences-slicer/pull/5#discussion_r28427452"},"pull_request":{"href":"https://api.github.com/repos/pelias/fences-slicer/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/pelias/fences-slicer/pulls/5","id":33261209,"html_url":"https://github.com/pelias/fences-slicer/pull/5","diff_url":"https://github.com/pelias/fences-slicer/pull/5.diff","patch_url":"https://github.com/pelias/fences-slicer/pull/5.patch","issue_url":"https://api.github.com/repos/pelias/fences-slicer/issues/5","number":5,"state":"open","locked":false,"title":"Process each input file in a dedicated child process","user":{"login":"dianashk","id":5446511,"avatar_url":"https://avatars.githubusercontent.com/u/5446511?v=3","gravatar_id":"","url":"https://api.github.com/users/dianashk","html_url":"https://github.com/dianashk","followers_url":"https://api.github.com/users/dianashk/followers","following_url":"https://api.github.com/users/dianashk/following{/other_user}","gists_url":"https://api.github.com/users/dianashk/gists{/gist_id}","starred_url":"https://api.github.com/users/dianashk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dianashk/subscriptions","organizations_url":"https://api.github.com/users/dianashk/orgs","repos_url":"https://api.github.com/users/dianashk/repos","events_url":"https://api.github.com/users/dianashk/events{/privacy}","received_events_url":"https://api.github.com/users/dianashk/received_events","type":"User","site_admin":false},"body":"Also change the region bounding box syntax to be more self explanatory.","created_at":"2015-04-14T14:14:54Z","updated_at":"2015-04-15T15:01:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"427108044c276b68b80a2afb429998d54faf4a1b","assignee":{"login":"dianashk","id":5446511,"avatar_url":"https://avatars.githubusercontent.com/u/5446511?v=3","gravatar_id":"","url":"https://api.github.com/users/dianashk","html_url":"https://github.com/dianashk","followers_url":"https://api.github.com/users/dianashk/followers","following_url":"https://api.github.com/users/dianashk/following{/other_user}","gists_url":"https://api.github.com/users/dianashk/gists{/gist_id}","starred_url":"https://api.github.com/users/dianashk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dianashk/subscriptions","organizations_url":"https://api.github.com/users/dianashk/orgs","repos_url":"https://api.github.com/users/dianashk/repos","events_url":"https://api.github.com/users/dianashk/events{/privacy}","received_events_url":"https://api.github.com/users/dianashk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pelias/fences-slicer/pulls/5/commits","review_comments_url":"https://api.github.com/repos/pelias/fences-slicer/pulls/5/comments","review_comment_url":"https://api.github.com/repos/pelias/fences-slicer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pelias/fences-slicer/issues/5/comments","statuses_url":"https://api.github.com/repos/pelias/fences-slicer/statuses/c7848a8609e1029b78f985effb39ec9137a86fea","head":{"label":"pelias:multi-process","ref":"multi-process","sha":"c7848a8609e1029b78f985effb39ec9137a86fea","user":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":32587388,"name":"fences-slicer","full_name":"pelias/fences-slicer","owner":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pelias/fences-slicer","description":"Utility for extracting data for regions from geojson files","fork":false,"url":"https://api.github.com/repos/pelias/fences-slicer","forks_url":"https://api.github.com/repos/pelias/fences-slicer/forks","keys_url":"https://api.github.com/repos/pelias/fences-slicer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/fences-slicer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/fences-slicer/teams","hooks_url":"https://api.github.com/repos/pelias/fences-slicer/hooks","issue_events_url":"https://api.github.com/repos/pelias/fences-slicer/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/fences-slicer/events","assignees_url":"https://api.github.com/repos/pelias/fences-slicer/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/fences-slicer/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/fences-slicer/tags","blobs_url":"https://api.github.com/repos/pelias/fences-slicer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/fences-slicer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/fences-slicer/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/fences-slicer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/fences-slicer/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/fences-slicer/languages","stargazers_url":"https://api.github.com/repos/pelias/fences-slicer/stargazers","contributors_url":"https://api.github.com/repos/pelias/fences-slicer/contributors","subscribers_url":"https://api.github.com/repos/pelias/fences-slicer/subscribers","subscription_url":"https://api.github.com/repos/pelias/fences-slicer/subscription","commits_url":"https://api.github.com/repos/pelias/fences-slicer/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/fences-slicer/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/fences-slicer/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/fences-slicer/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/fences-slicer/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/fences-slicer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/fences-slicer/merges","archive_url":"https://api.github.com/repos/pelias/fences-slicer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/fences-slicer/downloads","issues_url":"https://api.github.com/repos/pelias/fences-slicer/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/fences-slicer/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/fences-slicer/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/fences-slicer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/fences-slicer/labels{/name}","releases_url":"https://api.github.com/repos/pelias/fences-slicer/releases{/id}","created_at":"2015-03-20T14:10:24Z","updated_at":"2015-04-10T19:26:25Z","pushed_at":"2015-04-15T13:58:17Z","git_url":"git://github.com/pelias/fences-slicer.git","ssh_url":"git@github.com:pelias/fences-slicer.git","clone_url":"https://github.com/pelias/fences-slicer.git","svn_url":"https://github.com/pelias/fences-slicer","homepage":null,"size":204,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"pelias:master","ref":"master","sha":"56c3b7ca2637ff1a3c5f747f469d9d6f60af6a87","user":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":32587388,"name":"fences-slicer","full_name":"pelias/fences-slicer","owner":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pelias/fences-slicer","description":"Utility for extracting data for regions from geojson files","fork":false,"url":"https://api.github.com/repos/pelias/fences-slicer","forks_url":"https://api.github.com/repos/pelias/fences-slicer/forks","keys_url":"https://api.github.com/repos/pelias/fences-slicer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/fences-slicer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/fences-slicer/teams","hooks_url":"https://api.github.com/repos/pelias/fences-slicer/hooks","issue_events_url":"https://api.github.com/repos/pelias/fences-slicer/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/fences-slicer/events","assignees_url":"https://api.github.com/repos/pelias/fences-slicer/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/fences-slicer/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/fences-slicer/tags","blobs_url":"https://api.github.com/repos/pelias/fences-slicer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/fences-slicer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/fences-slicer/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/fences-slicer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/fences-slicer/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/fences-slicer/languages","stargazers_url":"https://api.github.com/repos/pelias/fences-slicer/stargazers","contributors_url":"https://api.github.com/repos/pelias/fences-slicer/contributors","subscribers_url":"https://api.github.com/repos/pelias/fences-slicer/subscribers","subscription_url":"https://api.github.com/repos/pelias/fences-slicer/subscription","commits_url":"https://api.github.com/repos/pelias/fences-slicer/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/fences-slicer/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/fences-slicer/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/fences-slicer/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/fences-slicer/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/fences-slicer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/fences-slicer/merges","archive_url":"https://api.github.com/repos/pelias/fences-slicer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/fences-slicer/downloads","issues_url":"https://api.github.com/repos/pelias/fences-slicer/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/fences-slicer/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/fences-slicer/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/fences-slicer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/fences-slicer/labels{/name}","releases_url":"https://api.github.com/repos/pelias/fences-slicer/releases{/id}","created_at":"2015-03-20T14:10:24Z","updated_at":"2015-04-10T19:26:25Z","pushed_at":"2015-04-15T13:58:17Z","git_url":"git://github.com/pelias/fences-slicer.git","ssh_url":"git@github.com:pelias/fences-slicer.git","clone_url":"https://github.com/pelias/fences-slicer.git","svn_url":"https://github.com/pelias/fences-slicer","homepage":null,"size":204,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pelias/fences-slicer/pulls/5"},"html":{"href":"https://github.com/pelias/fences-slicer/pull/5"},"issue":{"href":"https://api.github.com/repos/pelias/fences-slicer/issues/5"},"comments":{"href":"https://api.github.com/repos/pelias/fences-slicer/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/pelias/fences-slicer/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/pelias/fences-slicer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pelias/fences-slicer/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/pelias/fences-slicer/statuses/c7848a8609e1029b78f985effb39ec9137a86fea"}}}}