Class: Async::Redis::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/3scale/backend/storage_async/async_redis.rb

Instance Method Summary collapse

Instance Method Details

#call_pipeline(commands) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/3scale/backend/storage_async/async_redis.rb', line 8

def call_pipeline(commands)
  @pool.acquire do |connection|
    commands.each do |command|
      connection.write_request(command)
    end

    connection.flush

    commands.size.times.map { connection.read_response }
  end
end