{"action":"created","issue":{"url":"https://api.github.com/repos/Runnable/hermes/issues/28","labels_url":"https://api.github.com/repos/Runnable/hermes/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/Runnable/hermes/issues/28/comments","events_url":"https://api.github.com/repos/Runnable/hermes/issues/28/events","html_url":"https://github.com/Runnable/hermes/pull/28","id":114728307,"number":28,"title":"make rabbitmq handle events","user":{"login":"anandkumarpatel","id":2194285,"avatar_url":"https://avatars.githubusercontent.com/u/2194285?v=3","gravatar_id":"","url":"https://api.github.com/users/anandkumarpatel","html_url":"https://github.com/anandkumarpatel","followers_url":"https://api.github.com/users/anandkumarpatel/followers","following_url":"https://api.github.com/users/anandkumarpatel/following{/other_user}","gists_url":"https://api.github.com/users/anandkumarpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/anandkumarpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandkumarpatel/subscriptions","organizations_url":"https://api.github.com/users/anandkumarpatel/orgs","repos_url":"https://api.github.com/users/anandkumarpatel/repos","events_url":"https://api.github.com/users/anandkumarpatel/events{/privacy}","received_events_url":"https://api.github.com/users/anandkumarpatel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-03T02:18:31Z","updated_at":"2015-11-11T20:45:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Runnable/hermes/pulls/28","html_url":"https://github.com/Runnable/hermes/pull/28","diff_url":"https://github.com/Runnable/hermes/pull/28.diff","patch_url":"https://github.com/Runnable/hermes/pull/28.patch"},"body":"we are now needing to have more then one listener per \"event\" in order to do this we need to start publishing to exchanges.\r\n\r\nThis change is an opinionated way to do Pub/Sub events using `rabbitmq` I chose this way so we can have a uniform way to pass messages across the system without worrying about implementation details. This also provides a layer of abstraction between the queue service and the client  (ex we could swap out for redis events or some other event / broker application) We also follow the node style of event emitter because that is what we are building here.\r\n\r\nI am adding this new functionality while retaining old methods. \r\n\r\nTo use this new functionality you need to define the queues up front. I did this for two reasons\r\n1. We have queue information during initialization\r\n2. because of above we will fail early if we cannot assert queues.\r\n\r\nas part of the options object we will add \r\n`publishedEvents` and `subscribedEvents` which are arrays of the names of events we care about.\r\n\r\nto publish events we use the same api. `client.publish('event', data)`\r\n\r\nto subscribe to events you also use same api `client.subscribe('event', cb)`\r\n"},"comment":{"url":"https://api.github.com/repos/Runnable/hermes/issues/comments/155904641","html_url":"https://github.com/Runnable/hermes/pull/28#issuecomment-155904641","issue_url":"https://api.github.com/repos/Runnable/hermes/issues/28","id":155904641,"user":{"login":"podviaznikov","id":429706,"avatar_url":"https://avatars.githubusercontent.com/u/429706?v=3","gravatar_id":"","url":"https://api.github.com/users/podviaznikov","html_url":"https://github.com/podviaznikov","followers_url":"https://api.github.com/users/podviaznikov/followers","following_url":"https://api.github.com/users/podviaznikov/following{/other_user}","gists_url":"https://api.github.com/users/podviaznikov/gists{/gist_id}","starred_url":"https://api.github.com/users/podviaznikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/podviaznikov/subscriptions","organizations_url":"https://api.github.com/users/podviaznikov/orgs","repos_url":"https://api.github.com/users/podviaznikov/repos","events_url":"https://api.github.com/users/podviaznikov/events{/privacy}","received_events_url":"https://api.github.com/users/podviaznikov/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T20:45:25Z","updated_at":"2015-11-11T20:45:25Z","body":"looks good"}}