diff --git a/lib/redic/pool.rb b/lib/redic/pool.rb index 4acf428..65bbdd1 100644 --- a/lib/redic/pool.rb +++ b/lib/redic/pool.rb @@ -14,12 +14,6 @@ def initialize(url, options = {}) @id = "redic-pool-#{object_id}" end - def call(*args) - @pool.with do |client| - client.call(*args) - end - end - def queue(*args) Thread.current[@id] || (Thread.current[@id] = []) Thread.current[@id] << args @@ -38,4 +32,14 @@ def commit result end end + + %w[call call!].each do |method| + eval <<-STR + def #{method}(*args) + pool.with do |client| + client.#{method}(*args) + end + end + STR + end end