{"action":"created","comment":{"url":"https://api.github.com/repos/salemove/freddy/pulls/comments/40292331","id":40292331,"diff_hunk":"@@ -0,0 +1,34 @@\n+class Freddy\n+  class AdaptiveQueue\n+      def initialize(queue)\n+        @queue = queue\n+      end\n+\n+      def subscribe(&block)","path":"lib/freddy/adaptive_queue.rb","position":7,"original_position":7,"commit_id":"c31980f5eab19645053c3c56fe44825c20e3709c","original_commit_id":"c31980f5eab19645053c3c56fe44825c20e3709c","user":{"login":"urmastalimaa","id":5654666,"avatar_url":"https://avatars.githubusercontent.com/u/5654666?v=3","gravatar_id":"","url":"https://api.github.com/users/urmastalimaa","html_url":"https://github.com/urmastalimaa","followers_url":"https://api.github.com/users/urmastalimaa/followers","following_url":"https://api.github.com/users/urmastalimaa/following{/other_user}","gists_url":"https://api.github.com/users/urmastalimaa/gists{/gist_id}","starred_url":"https://api.github.com/users/urmastalimaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urmastalimaa/subscriptions","organizations_url":"https://api.github.com/users/urmastalimaa/orgs","repos_url":"https://api.github.com/users/urmastalimaa/repos","events_url":"https://api.github.com/users/urmastalimaa/events{/privacy}","received_events_url":"https://api.github.com/users/urmastalimaa/received_events","type":"User","site_admin":false},"body":"What about creating a `FreddyQueue` implementation with abstract `subscribe` and then creating two subclasses, one for bunny and one for march_hare? The old *replace `if` with polymorphism* refacto.","created_at":"2015-09-24T07:39:22Z","updated_at":"2015-09-24T07:39:22Z","html_url":"https://github.com/salemove/freddy/pull/19#discussion_r40292331","pull_request_url":"https://api.github.com/repos/salemove/freddy/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/salemove/freddy/pulls/comments/40292331"},"html":{"href":"https://github.com/salemove/freddy/pull/19#discussion_r40292331"},"pull_request":{"href":"https://api.github.com/repos/salemove/freddy/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/salemove/freddy/pulls/19","id":45799067,"html_url":"https://github.com/salemove/freddy/pull/19","diff_url":"https://github.com/salemove/freddy/pull/19.diff","patch_url":"https://github.com/salemove/freddy/pull/19.patch","issue_url":"https://api.github.com/repos/salemove/freddy/issues/19","number":19,"state":"open","locked":false,"title":"WIP: Make Freddy JRuby compatible","user":{"login":"madis","id":674621,"avatar_url":"https://avatars.githubusercontent.com/u/674621?v=3","gravatar_id":"","url":"https://api.github.com/users/madis","html_url":"https://github.com/madis","followers_url":"https://api.github.com/users/madis/followers","following_url":"https://api.github.com/users/madis/following{/other_user}","gists_url":"https://api.github.com/users/madis/gists{/gist_id}","starred_url":"https://api.github.com/users/madis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madis/subscriptions","organizations_url":"https://api.github.com/users/madis/orgs","repos_url":"https://api.github.com/users/madis/repos","events_url":"https://api.github.com/users/madis/events{/privacy}","received_events_url":"https://api.github.com/users/madis/received_events","type":"User","site_admin":false},"body":"This development will solve issues in using freddy with JRuby\r\nwhere because of Threads and no GIL. It does it currently by using\r\nanother AMQP implementation - March Hare. It is specific to JRuby.\r\n\r\nBecause of the differences between Bunny & March Hare, some adapter\r\ncode is needed. E.g. AdaptiveQueue and Producer.\r\n\r\nAfter these changes 2 gems would have to be built from this source:\r\n  - freddy (ruby implementation)\r\n  - freddy-jruby (jruby implementation)\r\n\r\nBy first making the Freddy compatible with JRuby will hopefully help to\r\ndiscover concurrency issues and fix them so that Freddy can be used with\r\nother Ruby implmemetations that have true concurrency e.g. Rubinius.","created_at":"2015-09-23T16:12:57Z","updated_at":"2015-09-24T07:39:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/salemove/freddy/pulls/19/commits","review_comments_url":"https://api.github.com/repos/salemove/freddy/pulls/19/comments","review_comment_url":"https://api.github.com/repos/salemove/freddy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/salemove/freddy/issues/19/comments","statuses_url":"https://api.github.com/repos/salemove/freddy/statuses/c31980f5eab19645053c3c56fe44825c20e3709c","head":{"label":"salemove:fix_concurrency_for_jruby","ref":"fix_concurrency_for_jruby","sha":"c31980f5eab19645053c3c56fe44825c20e3709c","user":{"login":"salemove","id":5281619,"avatar_url":"https://avatars.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":14983727,"name":"freddy","full_name":"salemove/freddy","owner":{"login":"salemove","id":5281619,"avatar_url":"https://avatars.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/freddy","description":"Messaging api supporting request-response and acknowledgements.","fork":false,"url":"https://api.github.com/repos/salemove/freddy","forks_url":"https://api.github.com/repos/salemove/freddy/forks","keys_url":"https://api.github.com/repos/salemove/freddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salemove/freddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salemove/freddy/teams","hooks_url":"https://api.github.com/repos/salemove/freddy/hooks","issue_events_url":"https://api.github.com/repos/salemove/freddy/issues/events{/number}","events_url":"https://api.github.com/repos/salemove/freddy/events","assignees_url":"https://api.github.com/repos/salemove/freddy/assignees{/user}","branches_url":"https://api.github.com/repos/salemove/freddy/branches{/branch}","tags_url":"https://api.github.com/repos/salemove/freddy/tags","blobs_url":"https://api.github.com/repos/salemove/freddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salemove/freddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salemove/freddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/salemove/freddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salemove/freddy/statuses/{sha}","languages_url":"https://api.github.com/repos/salemove/freddy/languages","stargazers_url":"https://api.github.com/repos/salemove/freddy/stargazers","contributors_url":"https://api.github.com/repos/salemove/freddy/contributors","subscribers_url":"https://api.github.com/repos/salemove/freddy/subscribers","subscription_url":"https://api.github.com/repos/salemove/freddy/subscription","commits_url":"https://api.github.com/repos/salemove/freddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/salemove/freddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/salemove/freddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/salemove/freddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/salemove/freddy/contents/{+path}","compare_url":"https://api.github.com/repos/salemove/freddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salemove/freddy/merges","archive_url":"https://api.github.com/repos/salemove/freddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salemove/freddy/downloads","issues_url":"https://api.github.com/repos/salemove/freddy/issues{/number}","pulls_url":"https://api.github.com/repos/salemove/freddy/pulls{/number}","milestones_url":"https://api.github.com/repos/salemove/freddy/milestones{/number}","notifications_url":"https://api.github.com/repos/salemove/freddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salemove/freddy/labels{/name}","releases_url":"https://api.github.com/repos/salemove/freddy/releases{/id}","created_at":"2013-12-06T13:43:21Z","updated_at":"2015-07-11T12:52:58Z","pushed_at":"2015-09-23T16:12:57Z","git_url":"git://github.com/salemove/freddy.git","ssh_url":"git@github.com:salemove/freddy.git","clone_url":"https://github.com/salemove/freddy.git","svn_url":"https://github.com/salemove/freddy","homepage":"","size":922,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"salemove:master","ref":"master","sha":"406a5fc9508a0633d1603f5dd22efd139644e62e","user":{"login":"salemove","id":5281619,"avatar_url":"https://avatars.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":14983727,"name":"freddy","full_name":"salemove/freddy","owner":{"login":"salemove","id":5281619,"avatar_url":"https://avatars.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/freddy","description":"Messaging api supporting request-response and acknowledgements.","fork":false,"url":"https://api.github.com/repos/salemove/freddy","forks_url":"https://api.github.com/repos/salemove/freddy/forks","keys_url":"https://api.github.com/repos/salemove/freddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salemove/freddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salemove/freddy/teams","hooks_url":"https://api.github.com/repos/salemove/freddy/hooks","issue_events_url":"https://api.github.com/repos/salemove/freddy/issues/events{/number}","events_url":"https://api.github.com/repos/salemove/freddy/events","assignees_url":"https://api.github.com/repos/salemove/freddy/assignees{/user}","branches_url":"https://api.github.com/repos/salemove/freddy/branches{/branch}","tags_url":"https://api.github.com/repos/salemove/freddy/tags","blobs_url":"https://api.github.com/repos/salemove/freddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salemove/freddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salemove/freddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/salemove/freddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salemove/freddy/statuses/{sha}","languages_url":"https://api.github.com/repos/salemove/freddy/languages","stargazers_url":"https://api.github.com/repos/salemove/freddy/stargazers","contributors_url":"https://api.github.com/repos/salemove/freddy/contributors","subscribers_url":"https://api.github.com/repos/salemove/freddy/subscribers","subscription_url":"https://api.github.com/repos/salemove/freddy/subscription","commits_url":"https://api.github.com/repos/salemove/freddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/salemove/freddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/salemove/freddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/salemove/freddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/salemove/freddy/contents/{+path}","compare_url":"https://api.github.com/repos/salemove/freddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salemove/freddy/merges","archive_url":"https://api.github.com/repos/salemove/freddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salemove/freddy/downloads","issues_url":"https://api.github.com/repos/salemove/freddy/issues{/number}","pulls_url":"https://api.github.com/repos/salemove/freddy/pulls{/number}","milestones_url":"https://api.github.com/repos/salemove/freddy/milestones{/number}","notifications_url":"https://api.github.com/repos/salemove/freddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salemove/freddy/labels{/name}","releases_url":"https://api.github.com/repos/salemove/freddy/releases{/id}","created_at":"2013-12-06T13:43:21Z","updated_at":"2015-07-11T12:52:58Z","pushed_at":"2015-09-23T16:12:57Z","git_url":"git://github.com/salemove/freddy.git","ssh_url":"git@github.com:salemove/freddy.git","clone_url":"https://github.com/salemove/freddy.git","svn_url":"https://github.com/salemove/freddy","homepage":"","size":922,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/salemove/freddy/pulls/19"},"html":{"href":"https://github.com/salemove/freddy/pull/19"},"issue":{"href":"https://api.github.com/repos/salemove/freddy/issues/19"},"comments":{"href":"https://api.github.com/repos/salemove/freddy/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/salemove/freddy/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/salemove/freddy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/salemove/freddy/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/salemove/freddy/statuses/c31980f5eab19645053c3c56fe44825c20e3709c"}}}}