{"action":"created","comment":{"url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/comments/90562278","pull_request_review_id":11081887,"id":90562278,"diff_hunk":"@@ -0,0 +1,50 @@\n+from nio.properties import StringProperty\n+from nio.signal.base import Signal\n+from nio.util.threading import spawn\n+\n+from .rethinkdb_base_block import RethinkDBBase\n+\n+\n+class RethinkDBChanges(RethinkDBBase):\n+    \"\"\"block to watch for changes from a RethinkDB and pass along any specified\n+    attributes\n+    \"\"\"\n+    table = StringProperty(title=\"Table to watch\", default='test',\n+                           allow_none=False)\n+\n+    def __init__(self):\n+        super().__init__()\n+        # current table being updated\n+        self._table = None\n+        self._watch_thread = None\n+        self._change_feed = None\n+\n+    def configure(self, context):\n+        super().configure(context)\n+        self._set_table()\n+        self._watch_thread = spawn(self.watch_for_changes)\n+\n+    def stop(self):\n+        self._change_feed.close()\n+        self._watch_thread.join(1)\n+        self.logger.debug('joined watch thread successfully')\n+        super().stop()\n+\n+    def watch_for_changes(self):\n+        self._change_feed = self._table.changes(squash=True).run(self._connection)\n+        self.logger.debug('change feed: {}'.format(self._change_feed))\n+\n+        while True:\n+            try:\n+                change = self._change_feed.next(wait=True)\n+            except:\n+                self.logger.exception('Could not get change (ignore if this '\n+                                      'block is stopping)')\n+                break","path":"rethinkdb_changes_block.py","position":43,"original_position":43,"commit_id":"444bed84a6696bdec11a8a974b4dd386463d3420","original_commit_id":"444bed84a6696bdec11a8a974b4dd386463d3420","user":{"login":"hansmosh","id":5524215,"avatar_url":"https://avatars.githubusercontent.com/u/5524215?v=3","gravatar_id":"","url":"https://api.github.com/users/hansmosh","html_url":"https://github.com/hansmosh","followers_url":"https://api.github.com/users/hansmosh/followers","following_url":"https://api.github.com/users/hansmosh/following{/other_user}","gists_url":"https://api.github.com/users/hansmosh/gists{/gist_id}","starred_url":"https://api.github.com/users/hansmosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansmosh/subscriptions","organizations_url":"https://api.github.com/users/hansmosh/orgs","repos_url":"https://api.github.com/users/hansmosh/repos","events_url":"https://api.github.com/users/hansmosh/events{/privacy}","received_events_url":"https://api.github.com/users/hansmosh/received_events","type":"User","site_admin":false},"body":"I think it's good to catch an exception when it's real. But when we're purposely stopping the block, not log the exception.","created_at":"2016-12-01T23:45:25Z","updated_at":"2016-12-01T23:45:25Z","html_url":"https://github.com/nio-blocks/rethink_db/pull/1#discussion_r90562278","pull_request_url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/comments/90562278"},"html":{"href":"https://github.com/nio-blocks/rethink_db/pull/1#discussion_r90562278"},"pull_request":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1","id":96189731,"html_url":"https://github.com/nio-blocks/rethink_db/pull/1","diff_url":"https://github.com/nio-blocks/rethink_db/pull/1.diff","patch_url":"https://github.com/nio-blocks/rethink_db/pull/1.patch","issue_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues/1","number":1,"state":"open","locked":false,"title":"RethinkDB Changes and Update Blocks AZZ-785","user":{"login":"dorzel","id":6152541,"avatar_url":"https://avatars.githubusercontent.com/u/6152541?v=3","gravatar_id":"","url":"https://api.github.com/users/dorzel","html_url":"https://github.com/dorzel","followers_url":"https://api.github.com/users/dorzel/followers","following_url":"https://api.github.com/users/dorzel/following{/other_user}","gists_url":"https://api.github.com/users/dorzel/gists{/gist_id}","starred_url":"https://api.github.com/users/dorzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorzel/subscriptions","organizations_url":"https://api.github.com/users/dorzel/orgs","repos_url":"https://api.github.com/users/dorzel/repos","events_url":"https://api.github.com/users/dorzel/events{/privacy}","received_events_url":"https://api.github.com/users/dorzel/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-01T23:08:03Z","updated_at":"2016-12-01T23:45:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dad2d7dc18a46215d61454224d1c7a8b5afafe85","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1/commits","review_comments_url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1/comments","review_comment_url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues/1/comments","statuses_url":"https://api.github.com/repos/nio-blocks/rethink_db/statuses/444bed84a6696bdec11a8a974b4dd386463d3420","head":{"label":"nio-blocks:develop","ref":"develop","sha":"444bed84a6696bdec11a8a974b4dd386463d3420","user":{"login":"nio-blocks","id":7684467,"avatar_url":"https://avatars.githubusercontent.com/u/7684467?v=3","gravatar_id":"","url":"https://api.github.com/users/nio-blocks","html_url":"https://github.com/nio-blocks","followers_url":"https://api.github.com/users/nio-blocks/followers","following_url":"https://api.github.com/users/nio-blocks/following{/other_user}","gists_url":"https://api.github.com/users/nio-blocks/gists{/gist_id}","starred_url":"https://api.github.com/users/nio-blocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nio-blocks/subscriptions","organizations_url":"https://api.github.com/users/nio-blocks/orgs","repos_url":"https://api.github.com/users/nio-blocks/repos","events_url":"https://api.github.com/users/nio-blocks/events{/privacy}","received_events_url":"https://api.github.com/users/nio-blocks/received_events","type":"Organization","site_admin":false},"repo":{"id":74511823,"name":"rethink_db","full_name":"nio-blocks/rethink_db","owner":{"login":"nio-blocks","id":7684467,"avatar_url":"https://avatars.githubusercontent.com/u/7684467?v=3","gravatar_id":"","url":"https://api.github.com/users/nio-blocks","html_url":"https://github.com/nio-blocks","followers_url":"https://api.github.com/users/nio-blocks/followers","following_url":"https://api.github.com/users/nio-blocks/following{/other_user}","gists_url":"https://api.github.com/users/nio-blocks/gists{/gist_id}","starred_url":"https://api.github.com/users/nio-blocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nio-blocks/subscriptions","organizations_url":"https://api.github.com/users/nio-blocks/orgs","repos_url":"https://api.github.com/users/nio-blocks/repos","events_url":"https://api.github.com/users/nio-blocks/events{/privacy}","received_events_url":"https://api.github.com/users/nio-blocks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nio-blocks/rethink_db","description":"A block for communicating with a RethinkDB server. ","fork":false,"url":"https://api.github.com/repos/nio-blocks/rethink_db","forks_url":"https://api.github.com/repos/nio-blocks/rethink_db/forks","keys_url":"https://api.github.com/repos/nio-blocks/rethink_db/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nio-blocks/rethink_db/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nio-blocks/rethink_db/teams","hooks_url":"https://api.github.com/repos/nio-blocks/rethink_db/hooks","issue_events_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues/events{/number}","events_url":"https://api.github.com/repos/nio-blocks/rethink_db/events","assignees_url":"https://api.github.com/repos/nio-blocks/rethink_db/assignees{/user}","branches_url":"https://api.github.com/repos/nio-blocks/rethink_db/branches{/branch}","tags_url":"https://api.github.com/repos/nio-blocks/rethink_db/tags","blobs_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/refs{/sha}","trees_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nio-blocks/rethink_db/statuses/{sha}","languages_url":"https://api.github.com/repos/nio-blocks/rethink_db/languages","stargazers_url":"https://api.github.com/repos/nio-blocks/rethink_db/stargazers","contributors_url":"https://api.github.com/repos/nio-blocks/rethink_db/contributors","subscribers_url":"https://api.github.com/repos/nio-blocks/rethink_db/subscribers","subscription_url":"https://api.github.com/repos/nio-blocks/rethink_db/subscription","commits_url":"https://api.github.com/repos/nio-blocks/rethink_db/commits{/sha}","git_commits_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/commits{/sha}","comments_url":"https://api.github.com/repos/nio-blocks/rethink_db/comments{/number}","issue_comment_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues/comments{/number}","contents_url":"https://api.github.com/repos/nio-blocks/rethink_db/contents/{+path}","compare_url":"https://api.github.com/repos/nio-blocks/rethink_db/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nio-blocks/rethink_db/merges","archive_url":"https://api.github.com/repos/nio-blocks/rethink_db/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nio-blocks/rethink_db/downloads","issues_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues{/number}","pulls_url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls{/number}","milestones_url":"https://api.github.com/repos/nio-blocks/rethink_db/milestones{/number}","notifications_url":"https://api.github.com/repos/nio-blocks/rethink_db/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nio-blocks/rethink_db/labels{/name}","releases_url":"https://api.github.com/repos/nio-blocks/rethink_db/releases{/id}","deployments_url":"https://api.github.com/repos/nio-blocks/rethink_db/deployments","created_at":"2016-11-22T20:48:07Z","updated_at":"2016-11-22T20:50:21Z","pushed_at":"2016-12-01T23:08:03Z","git_url":"git://github.com/nio-blocks/rethink_db.git","ssh_url":"git@github.com:nio-blocks/rethink_db.git","clone_url":"https://github.com/nio-blocks/rethink_db.git","svn_url":"https://github.com/nio-blocks/rethink_db","homepage":"https://www.rethinkdb.com/","size":24,"stargazers_count":0,"watchers_count":0,"language":null,"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":"nio2"}},"base":{"label":"nio-blocks:nio2","ref":"nio2","sha":"e499494b4a04ea56a4bb41416ba1757f7d14cf52","user":{"login":"nio-blocks","id":7684467,"avatar_url":"https://avatars.githubusercontent.com/u/7684467?v=3","gravatar_id":"","url":"https://api.github.com/users/nio-blocks","html_url":"https://github.com/nio-blocks","followers_url":"https://api.github.com/users/nio-blocks/followers","following_url":"https://api.github.com/users/nio-blocks/following{/other_user}","gists_url":"https://api.github.com/users/nio-blocks/gists{/gist_id}","starred_url":"https://api.github.com/users/nio-blocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nio-blocks/subscriptions","organizations_url":"https://api.github.com/users/nio-blocks/orgs","repos_url":"https://api.github.com/users/nio-blocks/repos","events_url":"https://api.github.com/users/nio-blocks/events{/privacy}","received_events_url":"https://api.github.com/users/nio-blocks/received_events","type":"Organization","site_admin":false},"repo":{"id":74511823,"name":"rethink_db","full_name":"nio-blocks/rethink_db","owner":{"login":"nio-blocks","id":7684467,"avatar_url":"https://avatars.githubusercontent.com/u/7684467?v=3","gravatar_id":"","url":"https://api.github.com/users/nio-blocks","html_url":"https://github.com/nio-blocks","followers_url":"https://api.github.com/users/nio-blocks/followers","following_url":"https://api.github.com/users/nio-blocks/following{/other_user}","gists_url":"https://api.github.com/users/nio-blocks/gists{/gist_id}","starred_url":"https://api.github.com/users/nio-blocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nio-blocks/subscriptions","organizations_url":"https://api.github.com/users/nio-blocks/orgs","repos_url":"https://api.github.com/users/nio-blocks/repos","events_url":"https://api.github.com/users/nio-blocks/events{/privacy}","received_events_url":"https://api.github.com/users/nio-blocks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nio-blocks/rethink_db","description":"A block for communicating with a RethinkDB server. ","fork":false,"url":"https://api.github.com/repos/nio-blocks/rethink_db","forks_url":"https://api.github.com/repos/nio-blocks/rethink_db/forks","keys_url":"https://api.github.com/repos/nio-blocks/rethink_db/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nio-blocks/rethink_db/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nio-blocks/rethink_db/teams","hooks_url":"https://api.github.com/repos/nio-blocks/rethink_db/hooks","issue_events_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues/events{/number}","events_url":"https://api.github.com/repos/nio-blocks/rethink_db/events","assignees_url":"https://api.github.com/repos/nio-blocks/rethink_db/assignees{/user}","branches_url":"https://api.github.com/repos/nio-blocks/rethink_db/branches{/branch}","tags_url":"https://api.github.com/repos/nio-blocks/rethink_db/tags","blobs_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/refs{/sha}","trees_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nio-blocks/rethink_db/statuses/{sha}","languages_url":"https://api.github.com/repos/nio-blocks/rethink_db/languages","stargazers_url":"https://api.github.com/repos/nio-blocks/rethink_db/stargazers","contributors_url":"https://api.github.com/repos/nio-blocks/rethink_db/contributors","subscribers_url":"https://api.github.com/repos/nio-blocks/rethink_db/subscribers","subscription_url":"https://api.github.com/repos/nio-blocks/rethink_db/subscription","commits_url":"https://api.github.com/repos/nio-blocks/rethink_db/commits{/sha}","git_commits_url":"https://api.github.com/repos/nio-blocks/rethink_db/git/commits{/sha}","comments_url":"https://api.github.com/repos/nio-blocks/rethink_db/comments{/number}","issue_comment_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues/comments{/number}","contents_url":"https://api.github.com/repos/nio-blocks/rethink_db/contents/{+path}","compare_url":"https://api.github.com/repos/nio-blocks/rethink_db/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nio-blocks/rethink_db/merges","archive_url":"https://api.github.com/repos/nio-blocks/rethink_db/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nio-blocks/rethink_db/downloads","issues_url":"https://api.github.com/repos/nio-blocks/rethink_db/issues{/number}","pulls_url":"https://api.github.com/repos/nio-blocks/rethink_db/pulls{/number}","milestones_url":"https://api.github.com/repos/nio-blocks/rethink_db/milestones{/number}","notifications_url":"https://api.github.com/repos/nio-blocks/rethink_db/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nio-blocks/rethink_db/labels{/name}","releases_url":"https://api.github.com/repos/nio-blocks/rethink_db/releases{/id}","deployments_url":"https://api.github.com/repos/nio-blocks/rethink_db/deployments","created_at":"2016-11-22T20:48:07Z","updated_at":"2016-11-22T20:50:21Z","pushed_at":"2016-12-01T23:08:03Z","git_url":"git://github.com/nio-blocks/rethink_db.git","ssh_url":"git@github.com:nio-blocks/rethink_db.git","clone_url":"https://github.com/nio-blocks/rethink_db.git","svn_url":"https://github.com/nio-blocks/rethink_db","homepage":"https://www.rethinkdb.com/","size":24,"stargazers_count":0,"watchers_count":0,"language":null,"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":"nio2"}},"_links":{"self":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1"},"html":{"href":"https://github.com/nio-blocks/rethink_db/pull/1"},"issue":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/issues/1"},"comments":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/nio-blocks/rethink_db/statuses/444bed84a6696bdec11a8a974b4dd386463d3420"}}}}
{"actor":{"display_login":"hansmosh"}}