{"action":"created","issue":{"url":"https://api.github.com/repos/ejfinneran/ratelimit/issues/21","repository_url":"https://api.github.com/repos/ejfinneran/ratelimit","labels_url":"https://api.github.com/repos/ejfinneran/ratelimit/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/ejfinneran/ratelimit/issues/21/comments","events_url":"https://api.github.com/repos/ejfinneran/ratelimit/issues/21/events","html_url":"https://github.com/ejfinneran/ratelimit/pull/21","id":175284566,"number":21,"title":"Making it possible to use a connection pool for getting a Redis instance","user":{"login":"mikebaldry","id":196514,"avatar_url":"https://avatars.githubusercontent.com/u/196514?v=3","gravatar_id":"","url":"https://api.github.com/users/mikebaldry","html_url":"https://github.com/mikebaldry","followers_url":"https://api.github.com/users/mikebaldry/followers","following_url":"https://api.github.com/users/mikebaldry/following{/other_user}","gists_url":"https://api.github.com/users/mikebaldry/gists{/gist_id}","starred_url":"https://api.github.com/users/mikebaldry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikebaldry/subscriptions","organizations_url":"https://api.github.com/users/mikebaldry/orgs","repos_url":"https://api.github.com/users/mikebaldry/repos","events_url":"https://api.github.com/users/mikebaldry/events{/privacy}","received_events_url":"https://api.github.com/users/mikebaldry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-06T15:56:32Z","updated_at":"2016-09-22T05:38:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ejfinneran/ratelimit/pulls/21","html_url":"https://github.com/ejfinneran/ratelimit/pull/21","diff_url":"https://github.com/ejfinneran/ratelimit/pull/21.diff","patch_url":"https://github.com/ejfinneran/ratelimit/pull/21.patch"},"body":"In some (most production, I'd have thought) projects you have a pool of Redis connections from which you can checkout a connection, perform your actions then put it back in to the pool ready for the next thing to use.\r\n\r\nThis is not possible with your current implementation so I've added an option `checkout_redis_with`, you can pass in a lambda which yields with the Redis connection.\r\n\r\nlooks like \r\n```ruby\r\nRatelimit.new(\"abc\", checkout_redis_with: -> (&block) { MyRedisPool.checkout(&block) })\r\n```\r\n\r\nor similar.\r\n\r\nThe original implementation still works the same, but checks out a connection when it needs to use one. \r\n\r\nI've also updated it to use MULTI instead of pipelining as expressed in a previous unanswered PR."},"comment":{"url":"https://api.github.com/repos/ejfinneran/ratelimit/issues/comments/248817048","html_url":"https://github.com/ejfinneran/ratelimit/pull/21#issuecomment-248817048","issue_url":"https://api.github.com/repos/ejfinneran/ratelimit/issues/21","id":248817048,"user":{"login":"ejfinneran","id":71407,"avatar_url":"https://avatars.githubusercontent.com/u/71407?v=3","gravatar_id":"","url":"https://api.github.com/users/ejfinneran","html_url":"https://github.com/ejfinneran","followers_url":"https://api.github.com/users/ejfinneran/followers","following_url":"https://api.github.com/users/ejfinneran/following{/other_user}","gists_url":"https://api.github.com/users/ejfinneran/gists{/gist_id}","starred_url":"https://api.github.com/users/ejfinneran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejfinneran/subscriptions","organizations_url":"https://api.github.com/users/ejfinneran/orgs","repos_url":"https://api.github.com/users/ejfinneran/repos","events_url":"https://api.github.com/users/ejfinneran/events{/privacy}","received_events_url":"https://api.github.com/users/ejfinneran/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T05:38:44Z","updated_at":"2016-09-22T05:38:44Z","body":"Are there other Redis libraries that use this pattern? I'm wondering if supporting https://github.com/mperham/connection_pool might be cleaner/easier."}}
{"actor":{"display_login":"ejfinneran"}}