{"action":"created","comment":{"url":"https://api.github.com/repos/datastax/python-driver/pulls/comments/22984532","id":22984532,"diff_hunk":"@@ -732,3 +743,90 @@ def deliver(self, timeout=None):\n             raise OperationTimedOut()\n         else:\n             return self.responses\n+\n+\n+class HeartbeatFuture(object):\n+    def __init__(self, connection, owner):\n+        self._exception = None\n+        self._event = Event()\n+        self.connection = connection\n+        self.owner = owner\n+        log.debug(\"Sending options message heartbeat on idle connection %s %s\",\n+                  id(connection), connection.host)\n+        with connection.lock:\n+            connection.send_msg(OptionsMessage(), connection.get_request_id(), self._options_callback)\n+            connection.in_flight += 1","path":"cassandra/connection.py","position":66,"original_position":66,"commit_id":"d2f3875599ccb702070c2fdfcf602b3e1b795cc9","original_commit_id":"d2f3875599ccb702070c2fdfcf602b3e1b795cc9","user":{"login":"thobbs","id":355580,"avatar_url":"https://avatars.githubusercontent.com/u/355580?v=3","gravatar_id":"","url":"https://api.github.com/users/thobbs","html_url":"https://github.com/thobbs","followers_url":"https://api.github.com/users/thobbs/followers","following_url":"https://api.github.com/users/thobbs/following{/other_user}","gists_url":"https://api.github.com/users/thobbs/gists{/gist_id}","starred_url":"https://api.github.com/users/thobbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thobbs/subscriptions","organizations_url":"https://api.github.com/users/thobbs/orgs","repos_url":"https://api.github.com/users/thobbs/repos","events_url":"https://api.github.com/users/thobbs/events{/privacy}","received_events_url":"https://api.github.com/users/thobbs/received_events","type":"User","site_admin":false},"body":"You need to check that ``in_flight`` is less than ``max_request_id`` before getting a new request ID.  (See ``wait_for_responses`` for one method of doing this.)","created_at":"2015-01-15T01:12:10Z","updated_at":"2015-01-15T01:12:10Z","html_url":"https://github.com/datastax/python-driver/pull/240#discussion_r22984532","pull_request_url":"https://api.github.com/repos/datastax/python-driver/pulls/240","_links":{"self":{"href":"https://api.github.com/repos/datastax/python-driver/pulls/comments/22984532"},"html":{"href":"https://github.com/datastax/python-driver/pull/240#discussion_r22984532"},"pull_request":{"href":"https://api.github.com/repos/datastax/python-driver/pulls/240"}}},"pull_request":{"url":"https://api.github.com/repos/datastax/python-driver/pulls/240","id":27278726,"html_url":"https://github.com/datastax/python-driver/pull/240","diff_url":"https://github.com/datastax/python-driver/pull/240.diff","patch_url":"https://github.com/datastax/python-driver/pull/240.patch","issue_url":"https://api.github.com/repos/datastax/python-driver/issues/240","number":240,"state":"open","locked":false,"title":"PYTHON-197 - Idle connection heartbeat","user":{"login":"aholmberg","id":1443722,"avatar_url":"https://avatars.githubusercontent.com/u/1443722?v=3","gravatar_id":"","url":"https://api.github.com/users/aholmberg","html_url":"https://github.com/aholmberg","followers_url":"https://api.github.com/users/aholmberg/followers","following_url":"https://api.github.com/users/aholmberg/following{/other_user}","gists_url":"https://api.github.com/users/aholmberg/gists{/gist_id}","starred_url":"https://api.github.com/users/aholmberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aholmberg/subscriptions","organizations_url":"https://api.github.com/users/aholmberg/orgs","repos_url":"https://api.github.com/users/aholmberg/repos","events_url":"https://api.github.com/users/aholmberg/events{/privacy}","received_events_url":"https://api.github.com/users/aholmberg/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-13T15:27:16Z","updated_at":"2015-01-15T01:12:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"234bc40b65c44d8371f9cdff5ea612cff98e57ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/datastax/python-driver/pulls/240/commits","review_comments_url":"https://api.github.com/repos/datastax/python-driver/pulls/240/comments","review_comment_url":"https://api.github.com/repos/datastax/python-driver/pulls/comments/{number}","comments_url":"https://api.github.com/repos/datastax/python-driver/issues/240/comments","statuses_url":"https://api.github.com/repos/datastax/python-driver/statuses/d2f3875599ccb702070c2fdfcf602b3e1b795cc9","head":{"label":"datastax:PYTHON-197","ref":"PYTHON-197","sha":"d2f3875599ccb702070c2fdfcf602b3e1b795cc9","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":11262602,"name":"python-driver","full_name":"datastax/python-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/python-driver","description":"DataStax Python Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/python-driver","forks_url":"https://api.github.com/repos/datastax/python-driver/forks","keys_url":"https://api.github.com/repos/datastax/python-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/python-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/python-driver/teams","hooks_url":"https://api.github.com/repos/datastax/python-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/python-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/python-driver/events","assignees_url":"https://api.github.com/repos/datastax/python-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/python-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/python-driver/tags","blobs_url":"https://api.github.com/repos/datastax/python-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/python-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/python-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/python-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/python-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/python-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/python-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/python-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/python-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/python-driver/subscription","commits_url":"https://api.github.com/repos/datastax/python-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/python-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/python-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/python-driver/issues/comments/{number}","contents_url":"https://api.github.com/repos/datastax/python-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/python-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/python-driver/merges","archive_url":"https://api.github.com/repos/datastax/python-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/python-driver/downloads","issues_url":"https://api.github.com/repos/datastax/python-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/python-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/python-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/python-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/python-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/python-driver/releases{/id}","created_at":"2013-07-08T19:02:31Z","updated_at":"2015-01-13T17:52:42Z","pushed_at":"2015-01-14T23:43:53Z","git_url":"git://github.com/datastax/python-driver.git","ssh_url":"git@github.com:datastax/python-driver.git","clone_url":"https://github.com/datastax/python-driver.git","svn_url":"https://github.com/datastax/python-driver","homepage":"","size":10220,"stargazers_count":269,"watchers_count":269,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":114,"mirror_url":null,"open_issues_count":5,"forks":114,"open_issues":5,"watchers":269,"default_branch":"master"}},"base":{"label":"datastax:master","ref":"master","sha":"21ac88035b30b508512092933dfafed185a65365","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":11262602,"name":"python-driver","full_name":"datastax/python-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/python-driver","description":"DataStax Python Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/python-driver","forks_url":"https://api.github.com/repos/datastax/python-driver/forks","keys_url":"https://api.github.com/repos/datastax/python-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/python-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/python-driver/teams","hooks_url":"https://api.github.com/repos/datastax/python-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/python-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/python-driver/events","assignees_url":"https://api.github.com/repos/datastax/python-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/python-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/python-driver/tags","blobs_url":"https://api.github.com/repos/datastax/python-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/python-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/python-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/python-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/python-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/python-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/python-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/python-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/python-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/python-driver/subscription","commits_url":"https://api.github.com/repos/datastax/python-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/python-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/python-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/python-driver/issues/comments/{number}","contents_url":"https://api.github.com/repos/datastax/python-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/python-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/python-driver/merges","archive_url":"https://api.github.com/repos/datastax/python-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/python-driver/downloads","issues_url":"https://api.github.com/repos/datastax/python-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/python-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/python-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/python-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/python-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/python-driver/releases{/id}","created_at":"2013-07-08T19:02:31Z","updated_at":"2015-01-13T17:52:42Z","pushed_at":"2015-01-14T23:43:53Z","git_url":"git://github.com/datastax/python-driver.git","ssh_url":"git@github.com:datastax/python-driver.git","clone_url":"https://github.com/datastax/python-driver.git","svn_url":"https://github.com/datastax/python-driver","homepage":"","size":10220,"stargazers_count":269,"watchers_count":269,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":114,"mirror_url":null,"open_issues_count":5,"forks":114,"open_issues":5,"watchers":269,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datastax/python-driver/pulls/240"},"html":{"href":"https://github.com/datastax/python-driver/pull/240"},"issue":{"href":"https://api.github.com/repos/datastax/python-driver/issues/240"},"comments":{"href":"https://api.github.com/repos/datastax/python-driver/issues/240/comments"},"review_comments":{"href":"https://api.github.com/repos/datastax/python-driver/pulls/240/comments"},"review_comment":{"href":"https://api.github.com/repos/datastax/python-driver/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/datastax/python-driver/pulls/240/commits"},"statuses":{"href":"https://api.github.com/repos/datastax/python-driver/statuses/d2f3875599ccb702070c2fdfcf602b3e1b795cc9"}}}}