{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/apache/incubator-groovy/pulls/4","id":33753597,"html_url":"https://github.com/apache/incubator-groovy/pull/4","diff_url":"https://github.com/apache/incubator-groovy/pull/4.diff","patch_url":"https://github.com/apache/incubator-groovy/pull/4.patch","issue_url":"https://api.github.com/repos/apache/incubator-groovy/issues/4","number":4,"state":"open","locked":false,"title":"[WIP] Event feature proposal","user":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"body":"This is a proposition to easier Event programming in Groovy. The feature is inspired from [C#'s Event Handler](https://msdn.microsoft.com/en-us/library/ms366768.aspx) feature syntax and aims to be very similar to Qt's signals and slots feature to exchange messages between object in an event-driven programming style. This is an idea I've had while working on [an android application writtent in Groovy](https://github.com/AugierLe42e/Pheobius)\r\n\r\nPlease note this is a very early work and I'm completely new in contributing to Groovy so please forgive me if I make mistakes.\r\n\r\nThe current system works like this :\r\n\r\n```\r\nclass ObjectWithEvent{\r\n    // Declare the event\r\n    public Event somethingChanged = new Event()\r\n\r\n    public void makeSomething()\r\n    // Code going on and then, something happens, you throw the event\r\n    somethingChanged(newValue)\r\n}\r\n\r\nclass ObjectListening{\r\n    //\r\n    private ObjectWithEvent objectWithEvent\r\n    public ObjectListening(){\r\n         // Subscribe to the event\r\n         objectWithEvent.somethingChanged += this.&onSomethingChanged\r\n    }\r\n\r\n    private void onSomethingChanged(){\r\n        // Code here\r\n    }\r\n}\r\n```\r\n\r\nThe main concern I have with the current implementation is the everything or nothing apsect. Either you make the event public but you are able to fire it from everywhere, either you make it private and you are not able to subscribe to it from outside. If you can help me with that.\r\n\r\nThe other concern I have is the reaction this could have with the @CompileStatic anotation for the type of the Closure.\r\n\r\nPlease tel me if this work interest you.\r\nThank you.","created_at":"2015-04-21T11:52:14Z","updated_at":"2015-04-21T11:52:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-groovy/pulls/4/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-groovy/pulls/4/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-groovy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-groovy/issues/4/comments","statuses_url":"https://api.github.com/repos/apache/incubator-groovy/statuses/f9d9aa5770e68a8a7dd3eadd1dec19d3b32d1540","head":{"label":"AugierLe42e:event-feature","ref":"event-feature","sha":"f9d9aa5770e68a8a7dd3eadd1dec19d3b32d1540","user":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"repo":{"id":34315781,"name":"incubator-groovy","full_name":"AugierLe42e/incubator-groovy","owner":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AugierLe42e/incubator-groovy","description":"Mirror of Apache Groovy (Incubating)","fork":true,"url":"https://api.github.com/repos/AugierLe42e/incubator-groovy","forks_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/forks","keys_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/teams","hooks_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/hooks","issue_events_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/issues/events{/number}","events_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/events","assignees_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/assignees{/user}","branches_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/branches{/branch}","tags_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/tags","blobs_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/git/refs{/sha}","trees_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/statuses/{sha}","languages_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/languages","stargazers_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/stargazers","contributors_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/contributors","subscribers_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/subscribers","subscription_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/subscription","commits_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/commits{/sha}","git_commits_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/git/commits{/sha}","comments_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/comments{/number}","issue_comment_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/issues/comments{/number}","contents_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/contents/{+path}","compare_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/merges","archive_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/downloads","issues_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/issues{/number}","pulls_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/pulls{/number}","milestones_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/milestones{/number}","notifications_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/labels{/name}","releases_url":"https://api.github.com/repos/AugierLe42e/incubator-groovy/releases{/id}","created_at":"2015-04-21T08:56:02Z","updated_at":"2015-04-21T08:56:12Z","pushed_at":"2015-04-21T11:40:26Z","git_url":"git://github.com/AugierLe42e/incubator-groovy.git","ssh_url":"git@github.com:AugierLe42e/incubator-groovy.git","clone_url":"https://github.com/AugierLe42e/incubator-groovy.git","svn_url":"https://github.com/AugierLe42e/incubator-groovy","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"19487e954a52c9ed775344c9820afefe1f374c79","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":34039690,"name":"incubator-groovy","full_name":"apache/incubator-groovy","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-groovy","description":"Mirror of Apache Groovy (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-groovy","forks_url":"https://api.github.com/repos/apache/incubator-groovy/forks","keys_url":"https://api.github.com/repos/apache/incubator-groovy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-groovy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-groovy/teams","hooks_url":"https://api.github.com/repos/apache/incubator-groovy/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-groovy/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-groovy/events","assignees_url":"https://api.github.com/repos/apache/incubator-groovy/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-groovy/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-groovy/tags","blobs_url":"https://api.github.com/repos/apache/incubator-groovy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-groovy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-groovy/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-groovy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-groovy/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-groovy/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-groovy/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-groovy/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-groovy/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-groovy/subscription","commits_url":"https://api.github.com/repos/apache/incubator-groovy/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-groovy/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-groovy/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-groovy/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-groovy/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-groovy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-groovy/merges","archive_url":"https://api.github.com/repos/apache/incubator-groovy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-groovy/downloads","issues_url":"https://api.github.com/repos/apache/incubator-groovy/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-groovy/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-groovy/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-groovy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-groovy/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-groovy/releases{/id}","created_at":"2015-04-16T07:00:05Z","updated_at":"2015-04-21T09:47:55Z","pushed_at":"2015-04-20T19:20:24Z","git_url":"git://github.com/apache/incubator-groovy.git","ssh_url":"git@github.com:apache/incubator-groovy.git","clone_url":"https://github.com/apache/incubator-groovy.git","svn_url":"https://github.com/apache/incubator-groovy","homepage":null,"size":0,"stargazers_count":66,"watchers_count":66,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":"git://git.apache.org/incubator-groovy.git","open_issues_count":4,"forks":9,"open_issues":4,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-groovy/pulls/4"},"html":{"href":"https://github.com/apache/incubator-groovy/pull/4"},"issue":{"href":"https://api.github.com/repos/apache/incubator-groovy/issues/4"},"comments":{"href":"https://api.github.com/repos/apache/incubator-groovy/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-groovy/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-groovy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-groovy/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-groovy/statuses/f9d9aa5770e68a8a7dd3eadd1dec19d3b32d1540"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":21,"deletions":0,"changed_files":1}}