{"action":"closed","number":8,"pull_request":{"url":"https://api.github.com/repos/salemove/ex_freddy/pulls/8","id":129191129,"html_url":"https://github.com/salemove/ex_freddy/pull/8","diff_url":"https://github.com/salemove/ex_freddy/pull/8.diff","patch_url":"https://github.com/salemove/ex_freddy/pull/8.patch","issue_url":"https://api.github.com/repos/salemove/ex_freddy/issues/8","number":8,"state":"closed","locked":false,"title":"Don't bind RPC.Client to fixed routing key","user":{"login":"take-five","id":1209413,"avatar_url":"https://avatars0.githubusercontent.com/u/1209413?v=3","gravatar_id":"","url":"https://api.github.com/users/take-five","html_url":"https://github.com/take-five","followers_url":"https://api.github.com/users/take-five/followers","following_url":"https://api.github.com/users/take-five/following{/other_user}","gists_url":"https://api.github.com/users/take-five/gists{/gist_id}","starred_url":"https://api.github.com/users/take-five/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/take-five/subscriptions","organizations_url":"https://api.github.com/users/take-five/orgs","repos_url":"https://api.github.com/users/take-five/repos","events_url":"https://api.github.com/users/take-five/events{/privacy}","received_events_url":"https://api.github.com/users/take-five/received_events","type":"User","site_admin":false},"body":"After using RPC.Client in real project, I've found out that\r\nbinding RPC Client to a single routing key leads to bad design. E.g.\r\nwe have to spawn several similar processes to communicate with\r\nseveral services whilst 1 process could do the same.\r\n\r\nThis commit allows to have one RPC.Client process for multiple services.\r\n\r\nFor example:\r\n```\r\ndefmodule MyApp.RPC.Client do\r\n  use Freddy.RPC.Client\r\n\r\n  def start_link(conn), do: Freddy.RPC.Client.start_link(__MODULE__, conn, [], nil, name: Client)\r\nend\r\n\r\ndefmodule MyApp.SitesService do\r\n  def get_sites(), do: MyApp.RPC.Client.request(Client, \"SitesQueue\", %{type: \"get_sites\"})\r\nend\r\n\r\ndefmodule MyApp.UsersService do\r\n  def get_users(), do: MyApp.RPC.Client.request(Client, \"SitesQueue\", %{type: \"get_useres\"})\r\nend\r\n```\r\n\r\nOne RPC.Client process can handle multiple requests at the same time.\r\n\r\nAlso, interface of `before_request`, `on_response` and `on_timeout` callbacks\r\nhas been changed. Now these callbacks accept `Freddy.RPC.Request` data structure\r\nas a first argument. This structure holds all necessary request information: payload,\r\nrouting key, options etc. In addition, callback `on_return` has been added which\r\nmirrors `on_return` callbacks from `hare` and follows the same semantics as the\r\ncallbacks, mentioned above.","created_at":"2017-07-06T13:53:29Z","updated_at":"2017-07-07T17:08:51Z","closed_at":"2017-07-07T17:08:51Z","merged_at":"2017-07-07T17:08:51Z","merge_commit_sha":"d771c5f7b955d52fec4c14d7b4bce0ee17b8f335","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/salemove/ex_freddy/pulls/8/commits","review_comments_url":"https://api.github.com/repos/salemove/ex_freddy/pulls/8/comments","review_comment_url":"https://api.github.com/repos/salemove/ex_freddy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/salemove/ex_freddy/issues/8/comments","statuses_url":"https://api.github.com/repos/salemove/ex_freddy/statuses/1883877b08d71370503426b3919dc355a9e63a17","head":{"label":"salemove:change-rpc-client","ref":"change-rpc-client","sha":"1883877b08d71370503426b3919dc355a9e63a17","user":{"login":"salemove","id":5281619,"avatar_url":"https://avatars3.githubusercontent.com/u/5281619?v=3","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"repo":{"id":77840313,"name":"ex_freddy","full_name":"salemove/ex_freddy","owner":{"login":"salemove","id":5281619,"avatar_url":"https://avatars3.githubusercontent.com/u/5281619?v=3","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/salemove/ex_freddy","description":"Freddy for Elixir","fork":false,"url":"https://api.github.com/repos/salemove/ex_freddy","forks_url":"https://api.github.com/repos/salemove/ex_freddy/forks","keys_url":"https://api.github.com/repos/salemove/ex_freddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salemove/ex_freddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salemove/ex_freddy/teams","hooks_url":"https://api.github.com/repos/salemove/ex_freddy/hooks","issue_events_url":"https://api.github.com/repos/salemove/ex_freddy/issues/events{/number}","events_url":"https://api.github.com/repos/salemove/ex_freddy/events","assignees_url":"https://api.github.com/repos/salemove/ex_freddy/assignees{/user}","branches_url":"https://api.github.com/repos/salemove/ex_freddy/branches{/branch}","tags_url":"https://api.github.com/repos/salemove/ex_freddy/tags","blobs_url":"https://api.github.com/repos/salemove/ex_freddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salemove/ex_freddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salemove/ex_freddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/salemove/ex_freddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salemove/ex_freddy/statuses/{sha}","languages_url":"https://api.github.com/repos/salemove/ex_freddy/languages","stargazers_url":"https://api.github.com/repos/salemove/ex_freddy/stargazers","contributors_url":"https://api.github.com/repos/salemove/ex_freddy/contributors","subscribers_url":"https://api.github.com/repos/salemove/ex_freddy/subscribers","subscription_url":"https://api.github.com/repos/salemove/ex_freddy/subscription","commits_url":"https://api.github.com/repos/salemove/ex_freddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/salemove/ex_freddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/salemove/ex_freddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/salemove/ex_freddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/salemove/ex_freddy/contents/{+path}","compare_url":"https://api.github.com/repos/salemove/ex_freddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salemove/ex_freddy/merges","archive_url":"https://api.github.com/repos/salemove/ex_freddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salemove/ex_freddy/downloads","issues_url":"https://api.github.com/repos/salemove/ex_freddy/issues{/number}","pulls_url":"https://api.github.com/repos/salemove/ex_freddy/pulls{/number}","milestones_url":"https://api.github.com/repos/salemove/ex_freddy/milestones{/number}","notifications_url":"https://api.github.com/repos/salemove/ex_freddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salemove/ex_freddy/labels{/name}","releases_url":"https://api.github.com/repos/salemove/ex_freddy/releases{/id}","deployments_url":"https://api.github.com/repos/salemove/ex_freddy/deployments","created_at":"2017-01-02T14:48:16Z","updated_at":"2017-06-28T11:39:39Z","pushed_at":"2017-07-07T17:08:51Z","git_url":"git://github.com/salemove/ex_freddy.git","ssh_url":"git@github.com:salemove/ex_freddy.git","clone_url":"https://github.com/salemove/ex_freddy.git","svn_url":"https://github.com/salemove/ex_freddy","homepage":null,"size":81,"stargazers_count":1,"watchers_count":1,"language":"Elixir","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"salemove:master","ref":"master","sha":"801385ad7989c2470a99127212672eb955c25a7f","user":{"login":"salemove","id":5281619,"avatar_url":"https://avatars3.githubusercontent.com/u/5281619?v=3","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"repo":{"id":77840313,"name":"ex_freddy","full_name":"salemove/ex_freddy","owner":{"login":"salemove","id":5281619,"avatar_url":"https://avatars3.githubusercontent.com/u/5281619?v=3","gravatar_id":"","url":"https://api.github.com/users/salemove","html_url":"https://github.com/salemove","followers_url":"https://api.github.com/users/salemove/followers","following_url":"https://api.github.com/users/salemove/following{/other_user}","gists_url":"https://api.github.com/users/salemove/gists{/gist_id}","starred_url":"https://api.github.com/users/salemove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salemove/subscriptions","organizations_url":"https://api.github.com/users/salemove/orgs","repos_url":"https://api.github.com/users/salemove/repos","events_url":"https://api.github.com/users/salemove/events{/privacy}","received_events_url":"https://api.github.com/users/salemove/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/salemove/ex_freddy","description":"Freddy for Elixir","fork":false,"url":"https://api.github.com/repos/salemove/ex_freddy","forks_url":"https://api.github.com/repos/salemove/ex_freddy/forks","keys_url":"https://api.github.com/repos/salemove/ex_freddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salemove/ex_freddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salemove/ex_freddy/teams","hooks_url":"https://api.github.com/repos/salemove/ex_freddy/hooks","issue_events_url":"https://api.github.com/repos/salemove/ex_freddy/issues/events{/number}","events_url":"https://api.github.com/repos/salemove/ex_freddy/events","assignees_url":"https://api.github.com/repos/salemove/ex_freddy/assignees{/user}","branches_url":"https://api.github.com/repos/salemove/ex_freddy/branches{/branch}","tags_url":"https://api.github.com/repos/salemove/ex_freddy/tags","blobs_url":"https://api.github.com/repos/salemove/ex_freddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salemove/ex_freddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salemove/ex_freddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/salemove/ex_freddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salemove/ex_freddy/statuses/{sha}","languages_url":"https://api.github.com/repos/salemove/ex_freddy/languages","stargazers_url":"https://api.github.com/repos/salemove/ex_freddy/stargazers","contributors_url":"https://api.github.com/repos/salemove/ex_freddy/contributors","subscribers_url":"https://api.github.com/repos/salemove/ex_freddy/subscribers","subscription_url":"https://api.github.com/repos/salemove/ex_freddy/subscription","commits_url":"https://api.github.com/repos/salemove/ex_freddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/salemove/ex_freddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/salemove/ex_freddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/salemove/ex_freddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/salemove/ex_freddy/contents/{+path}","compare_url":"https://api.github.com/repos/salemove/ex_freddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salemove/ex_freddy/merges","archive_url":"https://api.github.com/repos/salemove/ex_freddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salemove/ex_freddy/downloads","issues_url":"https://api.github.com/repos/salemove/ex_freddy/issues{/number}","pulls_url":"https://api.github.com/repos/salemove/ex_freddy/pulls{/number}","milestones_url":"https://api.github.com/repos/salemove/ex_freddy/milestones{/number}","notifications_url":"https://api.github.com/repos/salemove/ex_freddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salemove/ex_freddy/labels{/name}","releases_url":"https://api.github.com/repos/salemove/ex_freddy/releases{/id}","deployments_url":"https://api.github.com/repos/salemove/ex_freddy/deployments","created_at":"2017-01-02T14:48:16Z","updated_at":"2017-06-28T11:39:39Z","pushed_at":"2017-07-07T17:08:51Z","git_url":"git://github.com/salemove/ex_freddy.git","ssh_url":"git@github.com:salemove/ex_freddy.git","clone_url":"https://github.com/salemove/ex_freddy.git","svn_url":"https://github.com/salemove/ex_freddy","homepage":null,"size":81,"stargazers_count":1,"watchers_count":1,"language":"Elixir","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/salemove/ex_freddy/pulls/8"},"html":{"href":"https://github.com/salemove/ex_freddy/pull/8"},"issue":{"href":"https://api.github.com/repos/salemove/ex_freddy/issues/8"},"comments":{"href":"https://api.github.com/repos/salemove/ex_freddy/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/salemove/ex_freddy/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/salemove/ex_freddy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/salemove/ex_freddy/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/salemove/ex_freddy/statuses/1883877b08d71370503426b3919dc355a9e63a17"}},"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"take-five","id":1209413,"avatar_url":"https://avatars0.githubusercontent.com/u/1209413?v=3","gravatar_id":"","url":"https://api.github.com/users/take-five","html_url":"https://github.com/take-five","followers_url":"https://api.github.com/users/take-five/followers","following_url":"https://api.github.com/users/take-five/following{/other_user}","gists_url":"https://api.github.com/users/take-five/gists{/gist_id}","starred_url":"https://api.github.com/users/take-five/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/take-five/subscriptions","organizations_url":"https://api.github.com/users/take-five/orgs","repos_url":"https://api.github.com/users/take-five/repos","events_url":"https://api.github.com/users/take-five/events{/privacy}","received_events_url":"https://api.github.com/users/take-five/received_events","type":"User","site_admin":false},"comments":3,"review_comments":20,"maintainer_can_modify":false,"commits":2,"additions":387,"deletions":154,"changed_files":6}}
{"actor":{"display_login":"take-five"}}