{"action":"opened","number":139,"pull_request":{"url":"https://api.github.com/repos/iancooper/Paramore/pulls/139","id":46011889,"html_url":"https://github.com/iancooper/Paramore/pull/139","diff_url":"https://github.com/iancooper/Paramore/pull/139.diff","patch_url":"https://github.com/iancooper/Paramore/pull/139.patch","issue_url":"https://api.github.com/repos/iancooper/Paramore/issues/139","number":139,"state":"open","locked":false,"title":"Example generic listener","user":{"login":"ianbattersby","id":185776,"avatar_url":"https://avatars.githubusercontent.com/u/185776?v=3","gravatar_id":"","url":"https://api.github.com/users/ianbattersby","html_url":"https://github.com/ianbattersby","followers_url":"https://api.github.com/users/ianbattersby/followers","following_url":"https://api.github.com/users/ianbattersby/following{/other_user}","gists_url":"https://api.github.com/users/ianbattersby/gists{/gist_id}","starred_url":"https://api.github.com/users/ianbattersby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianbattersby/subscriptions","organizations_url":"https://api.github.com/users/ianbattersby/orgs","repos_url":"https://api.github.com/users/ianbattersby/repos","events_url":"https://api.github.com/users/ianbattersby/events{/privacy}","received_events_url":"https://api.github.com/users/ianbattersby/received_events","type":"User","site_admin":false},"body":"As per program.cs;\r\n\r\n```\r\n    /// <summary>\r\n    /// GenericListener is an example of using Brighter with C# generics to reduce the boilerplate\r\n    /// code required to listen to messages (usually events) in a system. One usage of this might be to\r\n    /// capture all events in a system and feed into a backing store such as EventStore to then perform\r\n    /// Complex Event Processing (CEP).\r\n    /// \r\n    /// Typically for each message a Brighter solution will require;\r\n    ///     DataType POCO\r\n    ///     DataType Handler\r\n    ///     DataType MessageMapper\r\n    /// \r\n    /// If you are aiming to listen to (for example) 60 events in your system this effectively means\r\n    /// 180 C# class files, and potentially each with custom mapping code. \r\n    /// \r\n    /// Taking the notion that any backing store - such as EventStore - will store in a schemaless JSON \r\n    /// it is redundant to deserialize a messsage off a qeueue into a POCO, only to serialize back into \r\n    /// JSON. As such it is possible to imagine you can have a generic mapper and/or handler that can \r\n    /// deal with the majority of event objects.\r\n    /// \r\n    /// In the instance where a custom version of a mapper and/or handler is required for a particular \r\n    /// object type, or type for which it's derived from, this solution somewhat cruedly aims to hoist \r\n    /// those accordingly.\r\n    /// \r\n    /// public class MyEvent : Event(StoredEvent) {}\r\n    /// public class MySuperEvent : MyEvent {}\r\n    /// public class MyDuperEvent : MyEvent {}\r\n    /// \r\n    /// For example;\r\n    /// \r\n    /// RegisterGenericHandlersFor<MyEvent>(config);\r\n    /// \r\n    /// The above will look for all derived types of MyEvent and select handlers and/or mappers based on;\r\n    /// \r\n    /// 1. Match Type implementing IAmMessageMapper<MySuperEvent>\r\n    /// 2. Create Type of MyEventMapper<T> implementing IAmMessageMapper<T> where T is MySuperEvent\r\n    /// 3. Create Type of GenericMapper<T> implementing IamMessageMapper<T> where T is MySuperEvent\r\n    /// 4. .. do the same for IHandlerRequests<>.\r\n    /// \r\n    /// Thus to listen to an additional event;\r\n    /// \r\n    /// 1. Add connection to <serviceActivatorConnections /> with DataType (e.g. MySuperEvent)\r\n    /// 2. Add class in an inheritence chain that suits (e.g. public class MySuperEvent : MyEvent {})\r\n    /// 3. Optionally add MyEventMapper<T> (if not exists) or MySuperEventMapper : IAmMessageMapper<MySuperEvent> {}\r\n    /// 4. Optionally add MyEventHandler<T> (if not exists) or MySuperEventHandler : IHandleRequests<MySuperEvent> {}\r\n    /// </summary>\r\n```","created_at":"2015-09-25T13:31:55Z","updated_at":"2015-09-25T13:31:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iancooper/Paramore/pulls/139/commits","review_comments_url":"https://api.github.com/repos/iancooper/Paramore/pulls/139/comments","review_comment_url":"https://api.github.com/repos/iancooper/Paramore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iancooper/Paramore/issues/139/comments","statuses_url":"https://api.github.com/repos/iancooper/Paramore/statuses/682b4119e2a8c0c049c957f01a364a5dca4fadf4","head":{"label":"iancooper:example-genlistener","ref":"example-genlistener","sha":"682b4119e2a8c0c049c957f01a364a5dca4fadf4","user":{"login":"iancooper","id":45537,"avatar_url":"https://avatars.githubusercontent.com/u/45537?v=3","gravatar_id":"","url":"https://api.github.com/users/iancooper","html_url":"https://github.com/iancooper","followers_url":"https://api.github.com/users/iancooper/followers","following_url":"https://api.github.com/users/iancooper/following{/other_user}","gists_url":"https://api.github.com/users/iancooper/gists{/gist_id}","starred_url":"https://api.github.com/users/iancooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iancooper/subscriptions","organizations_url":"https://api.github.com/users/iancooper/orgs","repos_url":"https://api.github.com/users/iancooper/repos","events_url":"https://api.github.com/users/iancooper/events{/privacy}","received_events_url":"https://api.github.com/users/iancooper/received_events","type":"User","site_admin":false},"repo":{"id":1223855,"name":"Paramore","full_name":"iancooper/Paramore","owner":{"login":"iancooper","id":45537,"avatar_url":"https://avatars.githubusercontent.com/u/45537?v=3","gravatar_id":"","url":"https://api.github.com/users/iancooper","html_url":"https://github.com/iancooper","followers_url":"https://api.github.com/users/iancooper/followers","following_url":"https://api.github.com/users/iancooper/following{/other_user}","gists_url":"https://api.github.com/users/iancooper/gists{/gist_id}","starred_url":"https://api.github.com/users/iancooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iancooper/subscriptions","organizations_url":"https://api.github.com/users/iancooper/orgs","repos_url":"https://api.github.com/users/iancooper/repos","events_url":"https://api.github.com/users/iancooper/events{/privacy}","received_events_url":"https://api.github.com/users/iancooper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iancooper/Paramore","description":"Command Dispatcher, Processor, and Distributed Task Queue","fork":false,"url":"https://api.github.com/repos/iancooper/Paramore","forks_url":"https://api.github.com/repos/iancooper/Paramore/forks","keys_url":"https://api.github.com/repos/iancooper/Paramore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iancooper/Paramore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iancooper/Paramore/teams","hooks_url":"https://api.github.com/repos/iancooper/Paramore/hooks","issue_events_url":"https://api.github.com/repos/iancooper/Paramore/issues/events{/number}","events_url":"https://api.github.com/repos/iancooper/Paramore/events","assignees_url":"https://api.github.com/repos/iancooper/Paramore/assignees{/user}","branches_url":"https://api.github.com/repos/iancooper/Paramore/branches{/branch}","tags_url":"https://api.github.com/repos/iancooper/Paramore/tags","blobs_url":"https://api.github.com/repos/iancooper/Paramore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iancooper/Paramore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iancooper/Paramore/git/refs{/sha}","trees_url":"https://api.github.com/repos/iancooper/Paramore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iancooper/Paramore/statuses/{sha}","languages_url":"https://api.github.com/repos/iancooper/Paramore/languages","stargazers_url":"https://api.github.com/repos/iancooper/Paramore/stargazers","contributors_url":"https://api.github.com/repos/iancooper/Paramore/contributors","subscribers_url":"https://api.github.com/repos/iancooper/Paramore/subscribers","subscription_url":"https://api.github.com/repos/iancooper/Paramore/subscription","commits_url":"https://api.github.com/repos/iancooper/Paramore/commits{/sha}","git_commits_url":"https://api.github.com/repos/iancooper/Paramore/git/commits{/sha}","comments_url":"https://api.github.com/repos/iancooper/Paramore/comments{/number}","issue_comment_url":"https://api.github.com/repos/iancooper/Paramore/issues/comments{/number}","contents_url":"https://api.github.com/repos/iancooper/Paramore/contents/{+path}","compare_url":"https://api.github.com/repos/iancooper/Paramore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iancooper/Paramore/merges","archive_url":"https://api.github.com/repos/iancooper/Paramore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iancooper/Paramore/downloads","issues_url":"https://api.github.com/repos/iancooper/Paramore/issues{/number}","pulls_url":"https://api.github.com/repos/iancooper/Paramore/pulls{/number}","milestones_url":"https://api.github.com/repos/iancooper/Paramore/milestones{/number}","notifications_url":"https://api.github.com/repos/iancooper/Paramore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iancooper/Paramore/labels{/name}","releases_url":"https://api.github.com/repos/iancooper/Paramore/releases{/id}","created_at":"2011-01-05T19:06:54Z","updated_at":"2015-09-23T14:30:23Z","pushed_at":"2015-09-25T13:30:09Z","git_url":"git://github.com/iancooper/Paramore.git","ssh_url":"git@github.com:iancooper/Paramore.git","clone_url":"https://github.com/iancooper/Paramore.git","svn_url":"https://github.com/iancooper/Paramore","homepage":"http://iancooper.github.io/Paramore","size":547336,"stargazers_count":178,"watchers_count":178,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":55,"mirror_url":null,"open_issues_count":30,"forks":55,"open_issues":30,"watchers":178,"default_branch":"master"}},"base":{"label":"iancooper:master","ref":"master","sha":"3d3c604d9ad9aeb1a44accbff00fc5399c5a7871","user":{"login":"iancooper","id":45537,"avatar_url":"https://avatars.githubusercontent.com/u/45537?v=3","gravatar_id":"","url":"https://api.github.com/users/iancooper","html_url":"https://github.com/iancooper","followers_url":"https://api.github.com/users/iancooper/followers","following_url":"https://api.github.com/users/iancooper/following{/other_user}","gists_url":"https://api.github.com/users/iancooper/gists{/gist_id}","starred_url":"https://api.github.com/users/iancooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iancooper/subscriptions","organizations_url":"https://api.github.com/users/iancooper/orgs","repos_url":"https://api.github.com/users/iancooper/repos","events_url":"https://api.github.com/users/iancooper/events{/privacy}","received_events_url":"https://api.github.com/users/iancooper/received_events","type":"User","site_admin":false},"repo":{"id":1223855,"name":"Paramore","full_name":"iancooper/Paramore","owner":{"login":"iancooper","id":45537,"avatar_url":"https://avatars.githubusercontent.com/u/45537?v=3","gravatar_id":"","url":"https://api.github.com/users/iancooper","html_url":"https://github.com/iancooper","followers_url":"https://api.github.com/users/iancooper/followers","following_url":"https://api.github.com/users/iancooper/following{/other_user}","gists_url":"https://api.github.com/users/iancooper/gists{/gist_id}","starred_url":"https://api.github.com/users/iancooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iancooper/subscriptions","organizations_url":"https://api.github.com/users/iancooper/orgs","repos_url":"https://api.github.com/users/iancooper/repos","events_url":"https://api.github.com/users/iancooper/events{/privacy}","received_events_url":"https://api.github.com/users/iancooper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iancooper/Paramore","description":"Command Dispatcher, Processor, and Distributed Task Queue","fork":false,"url":"https://api.github.com/repos/iancooper/Paramore","forks_url":"https://api.github.com/repos/iancooper/Paramore/forks","keys_url":"https://api.github.com/repos/iancooper/Paramore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iancooper/Paramore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iancooper/Paramore/teams","hooks_url":"https://api.github.com/repos/iancooper/Paramore/hooks","issue_events_url":"https://api.github.com/repos/iancooper/Paramore/issues/events{/number}","events_url":"https://api.github.com/repos/iancooper/Paramore/events","assignees_url":"https://api.github.com/repos/iancooper/Paramore/assignees{/user}","branches_url":"https://api.github.com/repos/iancooper/Paramore/branches{/branch}","tags_url":"https://api.github.com/repos/iancooper/Paramore/tags","blobs_url":"https://api.github.com/repos/iancooper/Paramore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iancooper/Paramore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iancooper/Paramore/git/refs{/sha}","trees_url":"https://api.github.com/repos/iancooper/Paramore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iancooper/Paramore/statuses/{sha}","languages_url":"https://api.github.com/repos/iancooper/Paramore/languages","stargazers_url":"https://api.github.com/repos/iancooper/Paramore/stargazers","contributors_url":"https://api.github.com/repos/iancooper/Paramore/contributors","subscribers_url":"https://api.github.com/repos/iancooper/Paramore/subscribers","subscription_url":"https://api.github.com/repos/iancooper/Paramore/subscription","commits_url":"https://api.github.com/repos/iancooper/Paramore/commits{/sha}","git_commits_url":"https://api.github.com/repos/iancooper/Paramore/git/commits{/sha}","comments_url":"https://api.github.com/repos/iancooper/Paramore/comments{/number}","issue_comment_url":"https://api.github.com/repos/iancooper/Paramore/issues/comments{/number}","contents_url":"https://api.github.com/repos/iancooper/Paramore/contents/{+path}","compare_url":"https://api.github.com/repos/iancooper/Paramore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iancooper/Paramore/merges","archive_url":"https://api.github.com/repos/iancooper/Paramore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iancooper/Paramore/downloads","issues_url":"https://api.github.com/repos/iancooper/Paramore/issues{/number}","pulls_url":"https://api.github.com/repos/iancooper/Paramore/pulls{/number}","milestones_url":"https://api.github.com/repos/iancooper/Paramore/milestones{/number}","notifications_url":"https://api.github.com/repos/iancooper/Paramore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iancooper/Paramore/labels{/name}","releases_url":"https://api.github.com/repos/iancooper/Paramore/releases{/id}","created_at":"2011-01-05T19:06:54Z","updated_at":"2015-09-23T14:30:23Z","pushed_at":"2015-09-25T13:30:09Z","git_url":"git://github.com/iancooper/Paramore.git","ssh_url":"git@github.com:iancooper/Paramore.git","clone_url":"https://github.com/iancooper/Paramore.git","svn_url":"https://github.com/iancooper/Paramore","homepage":"http://iancooper.github.io/Paramore","size":547336,"stargazers_count":178,"watchers_count":178,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":55,"mirror_url":null,"open_issues_count":30,"forks":55,"open_issues":30,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iancooper/Paramore/pulls/139"},"html":{"href":"https://github.com/iancooper/Paramore/pull/139"},"issue":{"href":"https://api.github.com/repos/iancooper/Paramore/issues/139"},"comments":{"href":"https://api.github.com/repos/iancooper/Paramore/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/iancooper/Paramore/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/iancooper/Paramore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iancooper/Paramore/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/iancooper/Paramore/statuses/682b4119e2a8c0c049c957f01a364a5dca4fadf4"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":291945,"deletions":72,"changed_files":92}}