{"action":"created","comment":{"url":"https://api.github.com/repos/netty/netty/pulls/comments/60339237","id":60339237,"diff_hunk":"@@ -110,6 +110,13 @@ public void operationComplete(ChannelFuture future) throws Exception {\n     private final long writerIdleTimeNanos;\n     private final long allIdleTimeNanos;\n \n+    private final IdleStateEvent FIRST_READER_IDLE_STATE_EVENT = new IdleStateEvent(IdleState.READER_IDLE, true, this);\n+    private final IdleStateEvent READER_IDLE_STATE_EVENT = new IdleStateEvent(IdleState.READER_IDLE, false, this);","path":"handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java","position":5,"original_position":5,"commit_id":"674007c3cce463f9a24e578c67d37922c3344010","original_commit_id":"674007c3cce463f9a24e578c67d37922c3344010","user":{"login":"netkins","id":9507557,"avatar_url":"https://avatars.githubusercontent.com/u/9507557?v=3","gravatar_id":"","url":"https://api.github.com/users/netkins","html_url":"https://github.com/netkins","followers_url":"https://api.github.com/users/netkins/followers","following_url":"https://api.github.com/users/netkins/following{/other_user}","gists_url":"https://api.github.com/users/netkins/gists{/gist_id}","starred_url":"https://api.github.com/users/netkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netkins/subscriptions","organizations_url":"https://api.github.com/users/netkins/orgs","repos_url":"https://api.github.com/users/netkins/repos","events_url":"https://api.github.com/users/netkins/events{/privacy}","received_events_url":"https://api.github.com/users/netkins/received_events","type":"User","site_admin":false},"body":"![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) Rename this field \"READER_IDLE_STATE_EVENT\" to match the regular expression '^[a-z][a-zA-Z0-9]*$'. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](https://garage.netty.io/sonarqube/coding_rules#rule_key=squid%3AS00116)\n","created_at":"2016-04-20T01:30:39Z","updated_at":"2016-04-20T01:30:39Z","html_url":"https://github.com/netty/netty/pull/5164#discussion_r60339237","pull_request_url":"https://api.github.com/repos/netty/netty/pulls/5164","_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/comments/60339237"},"html":{"href":"https://github.com/netty/netty/pull/5164#discussion_r60339237"},"pull_request":{"href":"https://api.github.com/repos/netty/netty/pulls/5164"}}},"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/5164","id":67110029,"html_url":"https://github.com/netty/netty/pull/5164","diff_url":"https://github.com/netty/netty/pull/5164.diff","patch_url":"https://github.com/netty/netty/pull/5164.patch","issue_url":"https://api.github.com/repos/netty/netty/issues/5164","number":5164,"state":"open","locked":false,"title":"Identify the source of IdleStateEvents","user":{"login":"jchambers","id":31352,"avatar_url":"https://avatars.githubusercontent.com/u/31352?v=3","gravatar_id":"","url":"https://api.github.com/users/jchambers","html_url":"https://github.com/jchambers","followers_url":"https://api.github.com/users/jchambers/followers","following_url":"https://api.github.com/users/jchambers/following{/other_user}","gists_url":"https://api.github.com/users/jchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/jchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchambers/subscriptions","organizations_url":"https://api.github.com/users/jchambers/orgs","repos_url":"https://api.github.com/users/jchambers/repos","events_url":"https://api.github.com/users/jchambers/events{/privacy}","received_events_url":"https://api.github.com/users/jchambers/received_events","type":"User","site_admin":false},"body":"### Motivation\r\n\r\nSuppose you have an application that wants to flush all pending writes after 50ms of inactivity, but also wants to send a ping after a minute of inactivity. One solution would be to have an `IdleStateHandler` with a 50ms period and then have a handler that counted `IdleStateEvents`. Another—and possibly slightly more convenient—approach would be to have two `IdleStateHandlers` with different periods. The trouble there is that it's impossible to distinguish idle state events from the two handlers. This change allows callers to differentiate events from multiple `IdleStateHandlers`.\r\n\r\n### Modifications\r\n\r\n- Added a `source` property/getter to `IdleStateEvents`.\r\n- Made pre-defined `IdleStateEvents` properties of individual `IdleStateHandler` instances instead of static properties of the class.\r\n\r\n### Result\r\n\r\nHandlers can now identify which `IdleStateHandler` triggered an `IdleStateEvent`.","created_at":"2016-04-20T00:06:20Z","updated_at":"2016-04-20T01:30:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"475f762bcb83a4a60da7131473f81c3b4227541c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/netty/netty/pulls/5164/commits","review_comments_url":"https://api.github.com/repos/netty/netty/pulls/5164/comments","review_comment_url":"https://api.github.com/repos/netty/netty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netty/netty/issues/5164/comments","statuses_url":"https://api.github.com/repos/netty/netty/statuses/674007c3cce463f9a24e578c67d37922c3344010","head":{"label":"jchambers:idle_state_event_source","ref":"idle_state_event_source","sha":"674007c3cce463f9a24e578c67d37922c3344010","user":{"login":"jchambers","id":31352,"avatar_url":"https://avatars.githubusercontent.com/u/31352?v=3","gravatar_id":"","url":"https://api.github.com/users/jchambers","html_url":"https://github.com/jchambers","followers_url":"https://api.github.com/users/jchambers/followers","following_url":"https://api.github.com/users/jchambers/following{/other_user}","gists_url":"https://api.github.com/users/jchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/jchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchambers/subscriptions","organizations_url":"https://api.github.com/users/jchambers/orgs","repos_url":"https://api.github.com/users/jchambers/repos","events_url":"https://api.github.com/users/jchambers/events{/privacy}","received_events_url":"https://api.github.com/users/jchambers/received_events","type":"User","site_admin":false},"repo":{"id":49343920,"name":"netty","full_name":"jchambers/netty","owner":{"login":"jchambers","id":31352,"avatar_url":"https://avatars.githubusercontent.com/u/31352?v=3","gravatar_id":"","url":"https://api.github.com/users/jchambers","html_url":"https://github.com/jchambers","followers_url":"https://api.github.com/users/jchambers/followers","following_url":"https://api.github.com/users/jchambers/following{/other_user}","gists_url":"https://api.github.com/users/jchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/jchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchambers/subscriptions","organizations_url":"https://api.github.com/users/jchambers/orgs","repos_url":"https://api.github.com/users/jchambers/repos","events_url":"https://api.github.com/users/jchambers/events{/privacy}","received_events_url":"https://api.github.com/users/jchambers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jchambers/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":true,"url":"https://api.github.com/repos/jchambers/netty","forks_url":"https://api.github.com/repos/jchambers/netty/forks","keys_url":"https://api.github.com/repos/jchambers/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jchambers/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jchambers/netty/teams","hooks_url":"https://api.github.com/repos/jchambers/netty/hooks","issue_events_url":"https://api.github.com/repos/jchambers/netty/issues/events{/number}","events_url":"https://api.github.com/repos/jchambers/netty/events","assignees_url":"https://api.github.com/repos/jchambers/netty/assignees{/user}","branches_url":"https://api.github.com/repos/jchambers/netty/branches{/branch}","tags_url":"https://api.github.com/repos/jchambers/netty/tags","blobs_url":"https://api.github.com/repos/jchambers/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jchambers/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jchambers/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/jchambers/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jchambers/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/jchambers/netty/languages","stargazers_url":"https://api.github.com/repos/jchambers/netty/stargazers","contributors_url":"https://api.github.com/repos/jchambers/netty/contributors","subscribers_url":"https://api.github.com/repos/jchambers/netty/subscribers","subscription_url":"https://api.github.com/repos/jchambers/netty/subscription","commits_url":"https://api.github.com/repos/jchambers/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/jchambers/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/jchambers/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/jchambers/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/jchambers/netty/contents/{+path}","compare_url":"https://api.github.com/repos/jchambers/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jchambers/netty/merges","archive_url":"https://api.github.com/repos/jchambers/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jchambers/netty/downloads","issues_url":"https://api.github.com/repos/jchambers/netty/issues{/number}","pulls_url":"https://api.github.com/repos/jchambers/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/jchambers/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/jchambers/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jchambers/netty/labels{/name}","releases_url":"https://api.github.com/repos/jchambers/netty/releases{/id}","deployments_url":"https://api.github.com/repos/jchambers/netty/deployments","created_at":"2016-01-09T22:27:42Z","updated_at":"2016-02-03T14:47:27Z","pushed_at":"2016-04-20T00:05:41Z","git_url":"git://github.com/jchambers/netty.git","ssh_url":"git@github.com:jchambers/netty.git","clone_url":"https://github.com/jchambers/netty.git","svn_url":"https://github.com/jchambers/netty","homepage":"http://netty.io/","size":44413,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"4.1"}},"base":{"label":"netty:4.1","ref":"4.1","sha":"38d05abd84c2971c68230289aad14066218a6141","user":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"repo":{"id":1064563,"name":"netty","full_name":"netty/netty","owner":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netty/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":false,"url":"https://api.github.com/repos/netty/netty","forks_url":"https://api.github.com/repos/netty/netty/forks","keys_url":"https://api.github.com/repos/netty/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netty/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netty/netty/teams","hooks_url":"https://api.github.com/repos/netty/netty/hooks","issue_events_url":"https://api.github.com/repos/netty/netty/issues/events{/number}","events_url":"https://api.github.com/repos/netty/netty/events","assignees_url":"https://api.github.com/repos/netty/netty/assignees{/user}","branches_url":"https://api.github.com/repos/netty/netty/branches{/branch}","tags_url":"https://api.github.com/repos/netty/netty/tags","blobs_url":"https://api.github.com/repos/netty/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netty/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netty/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/netty/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netty/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/netty/netty/languages","stargazers_url":"https://api.github.com/repos/netty/netty/stargazers","contributors_url":"https://api.github.com/repos/netty/netty/contributors","subscribers_url":"https://api.github.com/repos/netty/netty/subscribers","subscription_url":"https://api.github.com/repos/netty/netty/subscription","commits_url":"https://api.github.com/repos/netty/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/netty/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/netty/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/netty/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/netty/netty/contents/{+path}","compare_url":"https://api.github.com/repos/netty/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netty/netty/merges","archive_url":"https://api.github.com/repos/netty/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netty/netty/downloads","issues_url":"https://api.github.com/repos/netty/netty/issues{/number}","pulls_url":"https://api.github.com/repos/netty/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/netty/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/netty/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netty/netty/labels{/name}","releases_url":"https://api.github.com/repos/netty/netty/releases{/id}","deployments_url":"https://api.github.com/repos/netty/netty/deployments","created_at":"2010-11-09T09:22:21Z","updated_at":"2016-04-19T23:22:07Z","pushed_at":"2016-04-20T00:06:20Z","git_url":"git://github.com/netty/netty.git","ssh_url":"git@github.com:netty/netty.git","clone_url":"https://github.com/netty/netty.git","svn_url":"https://github.com/netty/netty","homepage":"http://netty.io/","size":57813,"stargazers_count":6609,"watchers_count":6609,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3370,"mirror_url":null,"open_issues_count":320,"forks":3370,"open_issues":320,"watchers":6609,"default_branch":"4.1"}},"_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/5164"},"html":{"href":"https://github.com/netty/netty/pull/5164"},"issue":{"href":"https://api.github.com/repos/netty/netty/issues/5164"},"comments":{"href":"https://api.github.com/repos/netty/netty/issues/5164/comments"},"review_comments":{"href":"https://api.github.com/repos/netty/netty/pulls/5164/comments"},"review_comment":{"href":"https://api.github.com/repos/netty/netty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netty/netty/pulls/5164/commits"},"statuses":{"href":"https://api.github.com/repos/netty/netty/statuses/674007c3cce463f9a24e578c67d37922c3344010"}}}}