{"action":"created","comment":{"url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/comments/77681074","id":77681074,"diff_hunk":"@@ -22,6 +21,69 @@ var uuid = require('uuid')\n firebaseAppRecords = {};\n firebaseAppRefMap = {};\n \n+//Worker tasks specs\n+var specs = {\n+  device_register: {\n+    error_state: \"error\",\n+    finished_state: \"device-register-completed\",\n+    in_progress_state: \"device-register-in-progress\",\n+    retries: 3,\n+    start_state: \"device-register\",\n+    timeout: 10000\n+  },\n+  application_install: {\n+    error_state: \"error\",\n+    in_progress_state: \"application-install-in-progress\",\n+    retries: 3,\n+    start_state: \"application-install\",\n+    timeout: 10000\n+  },\n+  application_create: {\n+    error_state: \"error\",\n+    in_progress_state: \"application-create-in-progress\",\n+    retries: 3,\n+    start_state: \"application-create\",\n+    timeout: 10000\n+  }\n+};\n+\n+var processTask = function (spec, options, error, finished, start, progress) {\n+  if (_.isUndefined(error)) error = function () { }\n+  if (_.isUndefined(finished)) finished = function () { }\n+  if (_.isUndefined(start)) start = function () { }\n+  if (_.isUndefined(progress)) progress = function () { }\n+  \n+  var key = firebaseQueueRef.push().key;","path":"index.js","position":41,"original_position":41,"commit_id":"7b303993791987d5ad3c815b2df8ea4481744ad6","original_commit_id":"7b303993791987d5ad3c815b2df8ea4481744ad6","user":{"login":"eighteyes","id":405274,"avatar_url":"https://avatars.githubusercontent.com/u/405274?v=3","gravatar_id":"","url":"https://api.github.com/users/eighteyes","html_url":"https://github.com/eighteyes","followers_url":"https://api.github.com/users/eighteyes/followers","following_url":"https://api.github.com/users/eighteyes/following{/other_user}","gists_url":"https://api.github.com/users/eighteyes/gists{/gist_id}","starred_url":"https://api.github.com/users/eighteyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eighteyes/subscriptions","organizations_url":"https://api.github.com/users/eighteyes/orgs","repos_url":"https://api.github.com/users/eighteyes/repos","events_url":"https://api.github.com/users/eighteyes/events{/privacy}","received_events_url":"https://api.github.com/users/eighteyes/received_events","type":"User","site_admin":false},"body":"plz add comments about what this is doing","created_at":"2016-09-06T17:29:51Z","updated_at":"2016-09-06T17:29:51Z","html_url":"https://github.com/matrix-io/matrix-firebase/pull/2#discussion_r77681074","pull_request_url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/comments/77681074"},"html":{"href":"https://github.com/matrix-io/matrix-firebase/pull/2#discussion_r77681074"},"pull_request":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2","id":84162937,"html_url":"https://github.com/matrix-io/matrix-firebase/pull/2","diff_url":"https://github.com/matrix-io/matrix-firebase/pull/2.diff","patch_url":"https://github.com/matrix-io/matrix-firebase/pull/2.patch","issue_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/2","number":2,"state":"open","locked":false,"title":"Simplified approach to handling worker tasks","user":{"login":"diegoribero","id":11444484,"avatar_url":"https://avatars.githubusercontent.com/u/11444484?v=3","gravatar_id":"","url":"https://api.github.com/users/diegoribero","html_url":"https://github.com/diegoribero","followers_url":"https://api.github.com/users/diegoribero/followers","following_url":"https://api.github.com/users/diegoribero/following{/other_user}","gists_url":"https://api.github.com/users/diegoribero/gists{/gist_id}","starred_url":"https://api.github.com/users/diegoribero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegoribero/subscriptions","organizations_url":"https://api.github.com/users/diegoribero/orgs","repos_url":"https://api.github.com/users/diegoribero/repos","events_url":"https://api.github.com/users/diegoribero/events{/privacy}","received_events_url":"https://api.github.com/users/diegoribero/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-06T17:26:57Z","updated_at":"2016-09-06T17:29:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a75cec921676a46e1312c8273aa531c96724c4e","assignee":{"login":"eighteyes","id":405274,"avatar_url":"https://avatars.githubusercontent.com/u/405274?v=3","gravatar_id":"","url":"https://api.github.com/users/eighteyes","html_url":"https://github.com/eighteyes","followers_url":"https://api.github.com/users/eighteyes/followers","following_url":"https://api.github.com/users/eighteyes/following{/other_user}","gists_url":"https://api.github.com/users/eighteyes/gists{/gist_id}","starred_url":"https://api.github.com/users/eighteyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eighteyes/subscriptions","organizations_url":"https://api.github.com/users/eighteyes/orgs","repos_url":"https://api.github.com/users/eighteyes/repos","events_url":"https://api.github.com/users/eighteyes/events{/privacy}","received_events_url":"https://api.github.com/users/eighteyes/received_events","type":"User","site_admin":false},"assignees":[{"login":"eighteyes","id":405274,"avatar_url":"https://avatars.githubusercontent.com/u/405274?v=3","gravatar_id":"","url":"https://api.github.com/users/eighteyes","html_url":"https://github.com/eighteyes","followers_url":"https://api.github.com/users/eighteyes/followers","following_url":"https://api.github.com/users/eighteyes/following{/other_user}","gists_url":"https://api.github.com/users/eighteyes/gists{/gist_id}","starred_url":"https://api.github.com/users/eighteyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eighteyes/subscriptions","organizations_url":"https://api.github.com/users/eighteyes/orgs","repos_url":"https://api.github.com/users/eighteyes/repos","events_url":"https://api.github.com/users/eighteyes/events{/privacy}","received_events_url":"https://api.github.com/users/eighteyes/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2/commits","review_comments_url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2/comments","review_comment_url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/2/comments","statuses_url":"https://api.github.com/repos/matrix-io/matrix-firebase/statuses/7b303993791987d5ad3c815b2df8ea4481744ad6","head":{"label":"matrix-io:dr/tasks","ref":"dr/tasks","sha":"7b303993791987d5ad3c815b2df8ea4481744ad6","user":{"login":"matrix-io","id":15808325,"avatar_url":"https://avatars.githubusercontent.com/u/15808325?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-io","html_url":"https://github.com/matrix-io","followers_url":"https://api.github.com/users/matrix-io/followers","following_url":"https://api.github.com/users/matrix-io/following{/other_user}","gists_url":"https://api.github.com/users/matrix-io/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-io/subscriptions","organizations_url":"https://api.github.com/users/matrix-io/orgs","repos_url":"https://api.github.com/users/matrix-io/repos","events_url":"https://api.github.com/users/matrix-io/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-io/received_events","type":"Organization","site_admin":false},"repo":{"id":55809936,"name":"matrix-firebase","full_name":"matrix-io/matrix-firebase","owner":{"login":"matrix-io","id":15808325,"avatar_url":"https://avatars.githubusercontent.com/u/15808325?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-io","html_url":"https://github.com/matrix-io","followers_url":"https://api.github.com/users/matrix-io/followers","following_url":"https://api.github.com/users/matrix-io/following{/other_user}","gists_url":"https://api.github.com/users/matrix-io/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-io/subscriptions","organizations_url":"https://api.github.com/users/matrix-io/orgs","repos_url":"https://api.github.com/users/matrix-io/repos","events_url":"https://api.github.com/users/matrix-io/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-io/matrix-firebase","description":"Firebase Integration","fork":false,"url":"https://api.github.com/repos/matrix-io/matrix-firebase","forks_url":"https://api.github.com/repos/matrix-io/matrix-firebase/forks","keys_url":"https://api.github.com/repos/matrix-io/matrix-firebase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-io/matrix-firebase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-io/matrix-firebase/teams","hooks_url":"https://api.github.com/repos/matrix-io/matrix-firebase/hooks","issue_events_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-io/matrix-firebase/events","assignees_url":"https://api.github.com/repos/matrix-io/matrix-firebase/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-io/matrix-firebase/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-io/matrix-firebase/tags","blobs_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-io/matrix-firebase/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-io/matrix-firebase/languages","stargazers_url":"https://api.github.com/repos/matrix-io/matrix-firebase/stargazers","contributors_url":"https://api.github.com/repos/matrix-io/matrix-firebase/contributors","subscribers_url":"https://api.github.com/repos/matrix-io/matrix-firebase/subscribers","subscription_url":"https://api.github.com/repos/matrix-io/matrix-firebase/subscription","commits_url":"https://api.github.com/repos/matrix-io/matrix-firebase/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-io/matrix-firebase/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-io/matrix-firebase/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-io/matrix-firebase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-io/matrix-firebase/merges","archive_url":"https://api.github.com/repos/matrix-io/matrix-firebase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-io/matrix-firebase/downloads","issues_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-io/matrix-firebase/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-io/matrix-firebase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-io/matrix-firebase/labels{/name}","releases_url":"https://api.github.com/repos/matrix-io/matrix-firebase/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-io/matrix-firebase/deployments","created_at":"2016-04-08T21:12:01Z","updated_at":"2016-07-18T17:10:30Z","pushed_at":"2016-09-06T17:26:57Z","git_url":"git://github.com/matrix-io/matrix-firebase.git","ssh_url":"git@github.com:matrix-io/matrix-firebase.git","clone_url":"https://github.com/matrix-io/matrix-firebase.git","svn_url":"https://github.com/matrix-io/matrix-firebase","homepage":"http://www.matrix.one","size":36,"stargazers_count":6,"watchers_count":6,"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":6,"default_branch":"master"}},"base":{"label":"matrix-io:master","ref":"master","sha":"50d553b7157176778c855d4a532ec63033158e65","user":{"login":"matrix-io","id":15808325,"avatar_url":"https://avatars.githubusercontent.com/u/15808325?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-io","html_url":"https://github.com/matrix-io","followers_url":"https://api.github.com/users/matrix-io/followers","following_url":"https://api.github.com/users/matrix-io/following{/other_user}","gists_url":"https://api.github.com/users/matrix-io/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-io/subscriptions","organizations_url":"https://api.github.com/users/matrix-io/orgs","repos_url":"https://api.github.com/users/matrix-io/repos","events_url":"https://api.github.com/users/matrix-io/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-io/received_events","type":"Organization","site_admin":false},"repo":{"id":55809936,"name":"matrix-firebase","full_name":"matrix-io/matrix-firebase","owner":{"login":"matrix-io","id":15808325,"avatar_url":"https://avatars.githubusercontent.com/u/15808325?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-io","html_url":"https://github.com/matrix-io","followers_url":"https://api.github.com/users/matrix-io/followers","following_url":"https://api.github.com/users/matrix-io/following{/other_user}","gists_url":"https://api.github.com/users/matrix-io/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-io/subscriptions","organizations_url":"https://api.github.com/users/matrix-io/orgs","repos_url":"https://api.github.com/users/matrix-io/repos","events_url":"https://api.github.com/users/matrix-io/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-io/matrix-firebase","description":"Firebase Integration","fork":false,"url":"https://api.github.com/repos/matrix-io/matrix-firebase","forks_url":"https://api.github.com/repos/matrix-io/matrix-firebase/forks","keys_url":"https://api.github.com/repos/matrix-io/matrix-firebase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-io/matrix-firebase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-io/matrix-firebase/teams","hooks_url":"https://api.github.com/repos/matrix-io/matrix-firebase/hooks","issue_events_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-io/matrix-firebase/events","assignees_url":"https://api.github.com/repos/matrix-io/matrix-firebase/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-io/matrix-firebase/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-io/matrix-firebase/tags","blobs_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-io/matrix-firebase/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-io/matrix-firebase/languages","stargazers_url":"https://api.github.com/repos/matrix-io/matrix-firebase/stargazers","contributors_url":"https://api.github.com/repos/matrix-io/matrix-firebase/contributors","subscribers_url":"https://api.github.com/repos/matrix-io/matrix-firebase/subscribers","subscription_url":"https://api.github.com/repos/matrix-io/matrix-firebase/subscription","commits_url":"https://api.github.com/repos/matrix-io/matrix-firebase/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-io/matrix-firebase/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-io/matrix-firebase/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-io/matrix-firebase/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-io/matrix-firebase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-io/matrix-firebase/merges","archive_url":"https://api.github.com/repos/matrix-io/matrix-firebase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-io/matrix-firebase/downloads","issues_url":"https://api.github.com/repos/matrix-io/matrix-firebase/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-io/matrix-firebase/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-io/matrix-firebase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-io/matrix-firebase/labels{/name}","releases_url":"https://api.github.com/repos/matrix-io/matrix-firebase/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-io/matrix-firebase/deployments","created_at":"2016-04-08T21:12:01Z","updated_at":"2016-07-18T17:10:30Z","pushed_at":"2016-09-06T17:26:57Z","git_url":"git://github.com/matrix-io/matrix-firebase.git","ssh_url":"git@github.com:matrix-io/matrix-firebase.git","clone_url":"https://github.com/matrix-io/matrix-firebase.git","svn_url":"https://github.com/matrix-io/matrix-firebase","homepage":"http://www.matrix.one","size":36,"stargazers_count":6,"watchers_count":6,"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":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2"},"html":{"href":"https://github.com/matrix-io/matrix-firebase/pull/2"},"issue":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/2"},"comments":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/matrix-io/matrix-firebase/statuses/7b303993791987d5ad3c815b2df8ea4481744ad6"}}}}
{"actor":{"display_login":"eighteyes"}}