{"action":"created","comment":{"url":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/comments/58857826","id":58857826,"diff_hunk":"@@ -107,4 +135,33 @@ function WS4Redis(options, $) {\n \t\treturn ws.readyState;\t\n \t};\n \t\n+\tfunction is_connecting() {\n+\t\treturn ws.readyState == 0;\t\n+\t}\n+\t\n+\tfunction is_connected() {\n+\t\treturn ws.readyState == 1;\t\n+\t}\n+\t\n+\tfunction is_closing() {\n+\t\treturn ws.readyState == 2;\t\n+\t}\n+\n+\tfunction is_closed() {\n+\t\treturn ws.readyState == 3;\t\n+\t}\n+\t\n+\t\n+\tthis.close = function () {\n+\t\tclearInterval(heartbeat_interval);\n+\t\tmust_reconnect = false;\n+\t\tif (!is_closing() || !is_closed()) {\n+\t\t\tws.close();\n+\t\t}\n+\t}\n+\t\n+\tthis.is_connecting = function () { is_connecting(); } ","path":"ws4redis/static/js/ws4redis.js","position":null,"original_position":125,"commit_id":"7cdde2accbe83652d19296b2769da4c6b34e0111","original_commit_id":"c9a39160ba86e0c8d1c3a94a920e003c2eba2adf","user":{"login":"yguarata","id":802909,"avatar_url":"https://avatars.githubusercontent.com/u/802909?v=3","gravatar_id":"","url":"https://api.github.com/users/yguarata","html_url":"https://github.com/yguarata","followers_url":"https://api.github.com/users/yguarata/followers","following_url":"https://api.github.com/users/yguarata/following{/other_user}","gists_url":"https://api.github.com/users/yguarata/gists{/gist_id}","starred_url":"https://api.github.com/users/yguarata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yguarata/subscriptions","organizations_url":"https://api.github.com/users/yguarata/orgs","repos_url":"https://api.github.com/users/yguarata/repos","events_url":"https://api.github.com/users/yguarata/events{/privacy}","received_events_url":"https://api.github.com/users/yguarata/received_events","type":"User","site_admin":false},"body":"Suggestion accepted. Fixed that in the last commit.","created_at":"2016-04-07T11:45:29Z","updated_at":"2016-04-07T11:45:29Z","html_url":"https://github.com/jrief/django-websocket-redis/pull/181#discussion_r58857826","pull_request_url":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181","_links":{"self":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/comments/58857826"},"html":{"href":"https://github.com/jrief/django-websocket-redis/pull/181#discussion_r58857826"},"pull_request":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181"}}},"pull_request":{"url":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181","id":65502162,"html_url":"https://github.com/jrief/django-websocket-redis/pull/181","diff_url":"https://github.com/jrief/django-websocket-redis/pull/181.diff","patch_url":"https://github.com/jrief/django-websocket-redis/pull/181.patch","issue_url":"https://api.github.com/repos/jrief/django-websocket-redis/issues/181","number":181,"state":"open","locked":false,"title":"Improvements in javascript API.","user":{"login":"yguarata","id":802909,"avatar_url":"https://avatars.githubusercontent.com/u/802909?v=3","gravatar_id":"","url":"https://api.github.com/users/yguarata","html_url":"https://github.com/yguarata","followers_url":"https://api.github.com/users/yguarata/followers","following_url":"https://api.github.com/users/yguarata/following{/other_user}","gists_url":"https://api.github.com/users/yguarata/gists{/gist_id}","starred_url":"https://api.github.com/users/yguarata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yguarata/subscriptions","organizations_url":"https://api.github.com/users/yguarata/orgs","repos_url":"https://api.github.com/users/yguarata/repos","events_url":"https://api.github.com/users/yguarata/events{/privacy}","received_events_url":"https://api.github.com/users/yguarata/received_events","type":"User","site_admin":false},"body":"Some improvements to the javascript API:\r\n\r\n- Trying to reconnect when the first attempt (on instantiation) fails.\r\n- Adding 'connecting' and 'disconnected' callback options.\r\n- Adding the 'close' method to the API. When the websocket is closed through this method, there will be no reconnection attempts.\r\n- Adding the following methods to the API to check websocket status: is_connecting, is_connected, is_closing, is_closed.\r\n\r\nThe documentation was also updated to reflect the changes.","created_at":"2016-04-06T17:07:44Z","updated_at":"2016-04-07T11:45:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53538ea908e2ddff50e86dc5c6c26c245cb8d329","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181/commits","review_comments_url":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181/comments","review_comment_url":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jrief/django-websocket-redis/issues/181/comments","statuses_url":"https://api.github.com/repos/jrief/django-websocket-redis/statuses/7cdde2accbe83652d19296b2769da4c6b34e0111","head":{"label":"yguarata:master","ref":"master","sha":"7cdde2accbe83652d19296b2769da4c6b34e0111","user":{"login":"yguarata","id":802909,"avatar_url":"https://avatars.githubusercontent.com/u/802909?v=3","gravatar_id":"","url":"https://api.github.com/users/yguarata","html_url":"https://github.com/yguarata","followers_url":"https://api.github.com/users/yguarata/followers","following_url":"https://api.github.com/users/yguarata/following{/other_user}","gists_url":"https://api.github.com/users/yguarata/gists{/gist_id}","starred_url":"https://api.github.com/users/yguarata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yguarata/subscriptions","organizations_url":"https://api.github.com/users/yguarata/orgs","repos_url":"https://api.github.com/users/yguarata/repos","events_url":"https://api.github.com/users/yguarata/events{/privacy}","received_events_url":"https://api.github.com/users/yguarata/received_events","type":"User","site_admin":false},"repo":{"id":55530901,"name":"django-websocket-redis","full_name":"yguarata/django-websocket-redis","owner":{"login":"yguarata","id":802909,"avatar_url":"https://avatars.githubusercontent.com/u/802909?v=3","gravatar_id":"","url":"https://api.github.com/users/yguarata","html_url":"https://github.com/yguarata","followers_url":"https://api.github.com/users/yguarata/followers","following_url":"https://api.github.com/users/yguarata/following{/other_user}","gists_url":"https://api.github.com/users/yguarata/gists{/gist_id}","starred_url":"https://api.github.com/users/yguarata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yguarata/subscriptions","organizations_url":"https://api.github.com/users/yguarata/orgs","repos_url":"https://api.github.com/users/yguarata/repos","events_url":"https://api.github.com/users/yguarata/events{/privacy}","received_events_url":"https://api.github.com/users/yguarata/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yguarata/django-websocket-redis","description":"Websockets for Django applications using Redis as message queue","fork":true,"url":"https://api.github.com/repos/yguarata/django-websocket-redis","forks_url":"https://api.github.com/repos/yguarata/django-websocket-redis/forks","keys_url":"https://api.github.com/repos/yguarata/django-websocket-redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yguarata/django-websocket-redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yguarata/django-websocket-redis/teams","hooks_url":"https://api.github.com/repos/yguarata/django-websocket-redis/hooks","issue_events_url":"https://api.github.com/repos/yguarata/django-websocket-redis/issues/events{/number}","events_url":"https://api.github.com/repos/yguarata/django-websocket-redis/events","assignees_url":"https://api.github.com/repos/yguarata/django-websocket-redis/assignees{/user}","branches_url":"https://api.github.com/repos/yguarata/django-websocket-redis/branches{/branch}","tags_url":"https://api.github.com/repos/yguarata/django-websocket-redis/tags","blobs_url":"https://api.github.com/repos/yguarata/django-websocket-redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yguarata/django-websocket-redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yguarata/django-websocket-redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/yguarata/django-websocket-redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yguarata/django-websocket-redis/statuses/{sha}","languages_url":"https://api.github.com/repos/yguarata/django-websocket-redis/languages","stargazers_url":"https://api.github.com/repos/yguarata/django-websocket-redis/stargazers","contributors_url":"https://api.github.com/repos/yguarata/django-websocket-redis/contributors","subscribers_url":"https://api.github.com/repos/yguarata/django-websocket-redis/subscribers","subscription_url":"https://api.github.com/repos/yguarata/django-websocket-redis/subscription","commits_url":"https://api.github.com/repos/yguarata/django-websocket-redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/yguarata/django-websocket-redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/yguarata/django-websocket-redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/yguarata/django-websocket-redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/yguarata/django-websocket-redis/contents/{+path}","compare_url":"https://api.github.com/repos/yguarata/django-websocket-redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yguarata/django-websocket-redis/merges","archive_url":"https://api.github.com/repos/yguarata/django-websocket-redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yguarata/django-websocket-redis/downloads","issues_url":"https://api.github.com/repos/yguarata/django-websocket-redis/issues{/number}","pulls_url":"https://api.github.com/repos/yguarata/django-websocket-redis/pulls{/number}","milestones_url":"https://api.github.com/repos/yguarata/django-websocket-redis/milestones{/number}","notifications_url":"https://api.github.com/repos/yguarata/django-websocket-redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yguarata/django-websocket-redis/labels{/name}","releases_url":"https://api.github.com/repos/yguarata/django-websocket-redis/releases{/id}","deployments_url":"https://api.github.com/repos/yguarata/django-websocket-redis/deployments","created_at":"2016-04-05T18:07:41Z","updated_at":"2016-04-05T18:07:42Z","pushed_at":"2016-04-07T11:43:25Z","git_url":"git://github.com/yguarata/django-websocket-redis.git","ssh_url":"git@github.com:yguarata/django-websocket-redis.git","clone_url":"https://github.com/yguarata/django-websocket-redis.git","svn_url":"https://github.com/yguarata/django-websocket-redis","homepage":"http://django-websocket-redis.awesto.com/","size":546,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"jrief:master","ref":"master","sha":"8a9ebf160a85c63e6904699a0f36e14248ffa547","user":{"login":"jrief","id":1132472,"avatar_url":"https://avatars.githubusercontent.com/u/1132472?v=3","gravatar_id":"","url":"https://api.github.com/users/jrief","html_url":"https://github.com/jrief","followers_url":"https://api.github.com/users/jrief/followers","following_url":"https://api.github.com/users/jrief/following{/other_user}","gists_url":"https://api.github.com/users/jrief/gists{/gist_id}","starred_url":"https://api.github.com/users/jrief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrief/subscriptions","organizations_url":"https://api.github.com/users/jrief/orgs","repos_url":"https://api.github.com/users/jrief/repos","events_url":"https://api.github.com/users/jrief/events{/privacy}","received_events_url":"https://api.github.com/users/jrief/received_events","type":"User","site_admin":false},"repo":{"id":15157083,"name":"django-websocket-redis","full_name":"jrief/django-websocket-redis","owner":{"login":"jrief","id":1132472,"avatar_url":"https://avatars.githubusercontent.com/u/1132472?v=3","gravatar_id":"","url":"https://api.github.com/users/jrief","html_url":"https://github.com/jrief","followers_url":"https://api.github.com/users/jrief/followers","following_url":"https://api.github.com/users/jrief/following{/other_user}","gists_url":"https://api.github.com/users/jrief/gists{/gist_id}","starred_url":"https://api.github.com/users/jrief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrief/subscriptions","organizations_url":"https://api.github.com/users/jrief/orgs","repos_url":"https://api.github.com/users/jrief/repos","events_url":"https://api.github.com/users/jrief/events{/privacy}","received_events_url":"https://api.github.com/users/jrief/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jrief/django-websocket-redis","description":"Websockets for Django applications using Redis as message queue","fork":false,"url":"https://api.github.com/repos/jrief/django-websocket-redis","forks_url":"https://api.github.com/repos/jrief/django-websocket-redis/forks","keys_url":"https://api.github.com/repos/jrief/django-websocket-redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jrief/django-websocket-redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jrief/django-websocket-redis/teams","hooks_url":"https://api.github.com/repos/jrief/django-websocket-redis/hooks","issue_events_url":"https://api.github.com/repos/jrief/django-websocket-redis/issues/events{/number}","events_url":"https://api.github.com/repos/jrief/django-websocket-redis/events","assignees_url":"https://api.github.com/repos/jrief/django-websocket-redis/assignees{/user}","branches_url":"https://api.github.com/repos/jrief/django-websocket-redis/branches{/branch}","tags_url":"https://api.github.com/repos/jrief/django-websocket-redis/tags","blobs_url":"https://api.github.com/repos/jrief/django-websocket-redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jrief/django-websocket-redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jrief/django-websocket-redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/jrief/django-websocket-redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jrief/django-websocket-redis/statuses/{sha}","languages_url":"https://api.github.com/repos/jrief/django-websocket-redis/languages","stargazers_url":"https://api.github.com/repos/jrief/django-websocket-redis/stargazers","contributors_url":"https://api.github.com/repos/jrief/django-websocket-redis/contributors","subscribers_url":"https://api.github.com/repos/jrief/django-websocket-redis/subscribers","subscription_url":"https://api.github.com/repos/jrief/django-websocket-redis/subscription","commits_url":"https://api.github.com/repos/jrief/django-websocket-redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/jrief/django-websocket-redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/jrief/django-websocket-redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/jrief/django-websocket-redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/jrief/django-websocket-redis/contents/{+path}","compare_url":"https://api.github.com/repos/jrief/django-websocket-redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jrief/django-websocket-redis/merges","archive_url":"https://api.github.com/repos/jrief/django-websocket-redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jrief/django-websocket-redis/downloads","issues_url":"https://api.github.com/repos/jrief/django-websocket-redis/issues{/number}","pulls_url":"https://api.github.com/repos/jrief/django-websocket-redis/pulls{/number}","milestones_url":"https://api.github.com/repos/jrief/django-websocket-redis/milestones{/number}","notifications_url":"https://api.github.com/repos/jrief/django-websocket-redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jrief/django-websocket-redis/labels{/name}","releases_url":"https://api.github.com/repos/jrief/django-websocket-redis/releases{/id}","deployments_url":"https://api.github.com/repos/jrief/django-websocket-redis/deployments","created_at":"2013-12-13T07:06:19Z","updated_at":"2016-04-06T09:09:40Z","pushed_at":"2016-04-07T11:43:26Z","git_url":"git://github.com/jrief/django-websocket-redis.git","ssh_url":"git@github.com:jrief/django-websocket-redis.git","clone_url":"https://github.com/jrief/django-websocket-redis.git","svn_url":"https://github.com/jrief/django-websocket-redis","homepage":"http://django-websocket-redis.awesto.com/","size":9677,"stargazers_count":456,"watchers_count":456,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":127,"mirror_url":null,"open_issues_count":54,"forks":127,"open_issues":54,"watchers":456,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181"},"html":{"href":"https://github.com/jrief/django-websocket-redis/pull/181"},"issue":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/issues/181"},"comments":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/jrief/django-websocket-redis/statuses/7cdde2accbe83652d19296b2769da4c6b34e0111"}}}}