Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/redic/pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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