{"action":"created","comment":{"url":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/comments/49168802","id":49168802,"diff_hunk":"@@ -0,0 +1,76 @@\n+require 'bunny'\r\n+\r\n+module NodeStarter\r\n+  # class wrapping connection to queue that stores uss nodes to be started\r\n+  class CmdConsumer\r\n+\t\r\n+    class QueueNotInitialized < StandardError\r\n+    end\r\n+\r\n+    def setup\r\n+      @conn = Bunny.new(\r\n+        hostname: NodeStarter.config.bunny_host,\r\n+        username: NodeStarter.config.bunny_user,\r\n+        password: NodeStarter.config.bunny_password\r\n+      )\r\n+      @conn.start\r\n+\r\n+      @channel = @conn.create_channel\r\n+      @exchange = @channel.direct(NodeStarter.config.stop_uss_node_queue_name)\r\n+\r\n+      queue_params = {\r\n+        durable: false,\r\n+        auto_delete: true,\r\n+        exclusive: true\r\n+      }\r\n+\r\n+      @queue = @channel.queue(\"\", queue_params)\r\n+    end\r\n+\r\n+    def register_id(id)\r","path":"lib/node_starter/cmd_consumer.rb","position":30,"original_position":30,"commit_id":"5732b1bf6e97779ea6a4d390a4c5e43ea7c87c5f","original_commit_id":"5732b1bf6e97779ea6a4d390a4c5e43ea7c87c5f","user":{"login":"panjan","id":2116809,"avatar_url":"https://avatars.githubusercontent.com/u/2116809?v=3","gravatar_id":"","url":"https://api.github.com/users/panjan","html_url":"https://github.com/panjan","followers_url":"https://api.github.com/users/panjan/followers","following_url":"https://api.github.com/users/panjan/following{/other_user}","gists_url":"https://api.github.com/users/panjan/gists{/gist_id}","starred_url":"https://api.github.com/users/panjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panjan/subscriptions","organizations_url":"https://api.github.com/users/panjan/orgs","repos_url":"https://api.github.com/users/panjan/repos","events_url":"https://api.github.com/users/panjan/events{/privacy}","received_events_url":"https://api.github.com/users/panjan/received_events","type":"User","site_admin":false},"body":"register_node(id)?","created_at":"2016-01-08T09:01:40Z","updated_at":"2016-01-08T09:01:40Z","html_url":"https://github.com/AVGTechnologies/node_starter/pull/9#discussion_r49168802","pull_request_url":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/comments/49168802"},"html":{"href":"https://github.com/AVGTechnologies/node_starter/pull/9#discussion_r49168802"},"pull_request":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9","id":53975308,"html_url":"https://github.com/AVGTechnologies/node_starter/pull/9","diff_url":"https://github.com/AVGTechnologies/node_starter/pull/9.diff","patch_url":"https://github.com/AVGTechnologies/node_starter/pull/9.patch","issue_url":"https://api.github.com/repos/AVGTechnologies/node_starter/issues/9","number":9,"state":"open","locked":false,"title":"feature: cmd queue, kill worker","user":{"login":"ireznice","id":8779206,"avatar_url":"https://avatars.githubusercontent.com/u/8779206?v=3","gravatar_id":"","url":"https://api.github.com/users/ireznice","html_url":"https://github.com/ireznice","followers_url":"https://api.github.com/users/ireznice/followers","following_url":"https://api.github.com/users/ireznice/following{/other_user}","gists_url":"https://api.github.com/users/ireznice/gists{/gist_id}","starred_url":"https://api.github.com/users/ireznice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ireznice/subscriptions","organizations_url":"https://api.github.com/users/ireznice/orgs","repos_url":"https://api.github.com/users/ireznice/repos","events_url":"https://api.github.com/users/ireznice/events{/privacy}","received_events_url":"https://api.github.com/users/ireznice/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-17T13:24:46Z","updated_at":"2016-01-08T09:01:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a3fcf7ab590ed26ef97862350b889a6b1e2ad18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9/commits","review_comments_url":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9/comments","review_comment_url":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AVGTechnologies/node_starter/issues/9/comments","statuses_url":"https://api.github.com/repos/AVGTechnologies/node_starter/statuses/5732b1bf6e97779ea6a4d390a4c5e43ea7c87c5f","head":{"label":"ireznice:ir_cmdkill","ref":"ir_cmdkill","sha":"5732b1bf6e97779ea6a4d390a4c5e43ea7c87c5f","user":{"login":"ireznice","id":8779206,"avatar_url":"https://avatars.githubusercontent.com/u/8779206?v=3","gravatar_id":"","url":"https://api.github.com/users/ireznice","html_url":"https://github.com/ireznice","followers_url":"https://api.github.com/users/ireznice/followers","following_url":"https://api.github.com/users/ireznice/following{/other_user}","gists_url":"https://api.github.com/users/ireznice/gists{/gist_id}","starred_url":"https://api.github.com/users/ireznice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ireznice/subscriptions","organizations_url":"https://api.github.com/users/ireznice/orgs","repos_url":"https://api.github.com/users/ireznice/repos","events_url":"https://api.github.com/users/ireznice/events{/privacy}","received_events_url":"https://api.github.com/users/ireznice/received_events","type":"User","site_admin":false},"repo":{"id":47116394,"name":"node_starter","full_name":"ireznice/node_starter","owner":{"login":"ireznice","id":8779206,"avatar_url":"https://avatars.githubusercontent.com/u/8779206?v=3","gravatar_id":"","url":"https://api.github.com/users/ireznice","html_url":"https://github.com/ireznice","followers_url":"https://api.github.com/users/ireznice/followers","following_url":"https://api.github.com/users/ireznice/following{/other_user}","gists_url":"https://api.github.com/users/ireznice/gists{/gist_id}","starred_url":"https://api.github.com/users/ireznice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ireznice/subscriptions","organizations_url":"https://api.github.com/users/ireznice/orgs","repos_url":"https://api.github.com/users/ireznice/repos","events_url":"https://api.github.com/users/ireznice/events{/privacy}","received_events_url":"https://api.github.com/users/ireznice/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ireznice/node_starter","description":"","fork":true,"url":"https://api.github.com/repos/ireznice/node_starter","forks_url":"https://api.github.com/repos/ireznice/node_starter/forks","keys_url":"https://api.github.com/repos/ireznice/node_starter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ireznice/node_starter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ireznice/node_starter/teams","hooks_url":"https://api.github.com/repos/ireznice/node_starter/hooks","issue_events_url":"https://api.github.com/repos/ireznice/node_starter/issues/events{/number}","events_url":"https://api.github.com/repos/ireznice/node_starter/events","assignees_url":"https://api.github.com/repos/ireznice/node_starter/assignees{/user}","branches_url":"https://api.github.com/repos/ireznice/node_starter/branches{/branch}","tags_url":"https://api.github.com/repos/ireznice/node_starter/tags","blobs_url":"https://api.github.com/repos/ireznice/node_starter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ireznice/node_starter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ireznice/node_starter/git/refs{/sha}","trees_url":"https://api.github.com/repos/ireznice/node_starter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ireznice/node_starter/statuses/{sha}","languages_url":"https://api.github.com/repos/ireznice/node_starter/languages","stargazers_url":"https://api.github.com/repos/ireznice/node_starter/stargazers","contributors_url":"https://api.github.com/repos/ireznice/node_starter/contributors","subscribers_url":"https://api.github.com/repos/ireznice/node_starter/subscribers","subscription_url":"https://api.github.com/repos/ireznice/node_starter/subscription","commits_url":"https://api.github.com/repos/ireznice/node_starter/commits{/sha}","git_commits_url":"https://api.github.com/repos/ireznice/node_starter/git/commits{/sha}","comments_url":"https://api.github.com/repos/ireznice/node_starter/comments{/number}","issue_comment_url":"https://api.github.com/repos/ireznice/node_starter/issues/comments{/number}","contents_url":"https://api.github.com/repos/ireznice/node_starter/contents/{+path}","compare_url":"https://api.github.com/repos/ireznice/node_starter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ireznice/node_starter/merges","archive_url":"https://api.github.com/repos/ireznice/node_starter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ireznice/node_starter/downloads","issues_url":"https://api.github.com/repos/ireznice/node_starter/issues{/number}","pulls_url":"https://api.github.com/repos/ireznice/node_starter/pulls{/number}","milestones_url":"https://api.github.com/repos/ireznice/node_starter/milestones{/number}","notifications_url":"https://api.github.com/repos/ireznice/node_starter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ireznice/node_starter/labels{/name}","releases_url":"https://api.github.com/repos/ireznice/node_starter/releases{/id}","created_at":"2015-11-30T12:17:08Z","updated_at":"2015-11-30T12:17:08Z","pushed_at":"2016-01-08T08:21:56Z","git_url":"git://github.com/ireznice/node_starter.git","ssh_url":"git@github.com:ireznice/node_starter.git","clone_url":"https://github.com/ireznice/node_starter.git","svn_url":"https://github.com/ireznice/node_starter","homepage":null,"size":32,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AVGTechnologies:master","ref":"master","sha":"b17ec8652cf0effbe2b596167cb7b80ea3b907df","user":{"login":"AVGTechnologies","id":13526630,"avatar_url":"https://avatars.githubusercontent.com/u/13526630?v=3","gravatar_id":"","url":"https://api.github.com/users/AVGTechnologies","html_url":"https://github.com/AVGTechnologies","followers_url":"https://api.github.com/users/AVGTechnologies/followers","following_url":"https://api.github.com/users/AVGTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/AVGTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/AVGTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AVGTechnologies/subscriptions","organizations_url":"https://api.github.com/users/AVGTechnologies/orgs","repos_url":"https://api.github.com/users/AVGTechnologies/repos","events_url":"https://api.github.com/users/AVGTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/AVGTechnologies/received_events","type":"Organization","site_admin":false},"repo":{"id":45978537,"name":"node_starter","full_name":"AVGTechnologies/node_starter","owner":{"login":"AVGTechnologies","id":13526630,"avatar_url":"https://avatars.githubusercontent.com/u/13526630?v=3","gravatar_id":"","url":"https://api.github.com/users/AVGTechnologies","html_url":"https://github.com/AVGTechnologies","followers_url":"https://api.github.com/users/AVGTechnologies/followers","following_url":"https://api.github.com/users/AVGTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/AVGTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/AVGTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AVGTechnologies/subscriptions","organizations_url":"https://api.github.com/users/AVGTechnologies/orgs","repos_url":"https://api.github.com/users/AVGTechnologies/repos","events_url":"https://api.github.com/users/AVGTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/AVGTechnologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AVGTechnologies/node_starter","description":"","fork":false,"url":"https://api.github.com/repos/AVGTechnologies/node_starter","forks_url":"https://api.github.com/repos/AVGTechnologies/node_starter/forks","keys_url":"https://api.github.com/repos/AVGTechnologies/node_starter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AVGTechnologies/node_starter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AVGTechnologies/node_starter/teams","hooks_url":"https://api.github.com/repos/AVGTechnologies/node_starter/hooks","issue_events_url":"https://api.github.com/repos/AVGTechnologies/node_starter/issues/events{/number}","events_url":"https://api.github.com/repos/AVGTechnologies/node_starter/events","assignees_url":"https://api.github.com/repos/AVGTechnologies/node_starter/assignees{/user}","branches_url":"https://api.github.com/repos/AVGTechnologies/node_starter/branches{/branch}","tags_url":"https://api.github.com/repos/AVGTechnologies/node_starter/tags","blobs_url":"https://api.github.com/repos/AVGTechnologies/node_starter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AVGTechnologies/node_starter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AVGTechnologies/node_starter/git/refs{/sha}","trees_url":"https://api.github.com/repos/AVGTechnologies/node_starter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AVGTechnologies/node_starter/statuses/{sha}","languages_url":"https://api.github.com/repos/AVGTechnologies/node_starter/languages","stargazers_url":"https://api.github.com/repos/AVGTechnologies/node_starter/stargazers","contributors_url":"https://api.github.com/repos/AVGTechnologies/node_starter/contributors","subscribers_url":"https://api.github.com/repos/AVGTechnologies/node_starter/subscribers","subscription_url":"https://api.github.com/repos/AVGTechnologies/node_starter/subscription","commits_url":"https://api.github.com/repos/AVGTechnologies/node_starter/commits{/sha}","git_commits_url":"https://api.github.com/repos/AVGTechnologies/node_starter/git/commits{/sha}","comments_url":"https://api.github.com/repos/AVGTechnologies/node_starter/comments{/number}","issue_comment_url":"https://api.github.com/repos/AVGTechnologies/node_starter/issues/comments{/number}","contents_url":"https://api.github.com/repos/AVGTechnologies/node_starter/contents/{+path}","compare_url":"https://api.github.com/repos/AVGTechnologies/node_starter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AVGTechnologies/node_starter/merges","archive_url":"https://api.github.com/repos/AVGTechnologies/node_starter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AVGTechnologies/node_starter/downloads","issues_url":"https://api.github.com/repos/AVGTechnologies/node_starter/issues{/number}","pulls_url":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls{/number}","milestones_url":"https://api.github.com/repos/AVGTechnologies/node_starter/milestones{/number}","notifications_url":"https://api.github.com/repos/AVGTechnologies/node_starter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AVGTechnologies/node_starter/labels{/name}","releases_url":"https://api.github.com/repos/AVGTechnologies/node_starter/releases{/id}","created_at":"2015-11-11T11:46:25Z","updated_at":"2015-11-18T08:51:45Z","pushed_at":"2016-01-08T08:21:56Z","git_url":"git://github.com/AVGTechnologies/node_starter.git","ssh_url":"git@github.com:AVGTechnologies/node_starter.git","clone_url":"https://github.com/AVGTechnologies/node_starter.git","svn_url":"https://github.com/AVGTechnologies/node_starter","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9"},"html":{"href":"https://github.com/AVGTechnologies/node_starter/pull/9"},"issue":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/issues/9"},"comments":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/AVGTechnologies/node_starter/statuses/5732b1bf6e97779ea6a4d390a4c5e43ea7c87c5f"}}}}