class Async::Redis::Context::Generic

Public Class Methods

new(pool, *arguments) click to toggle source
# File lib/async/redis/context/generic.rb, line 30
def initialize(pool, *arguments)
        @pool = pool
        @connection = pool.acquire
end

Public Instance Methods

call(command, *arguments) click to toggle source
# File lib/async/redis/context/generic.rb, line 52
def call(command, *arguments)
        write_request(command, *arguments)
        
        return read_response
end
close() click to toggle source
# File lib/async/redis/context/generic.rb, line 35
def close
        if @connection
                @pool.release(@connection)
                @connection = nil
        end
end
read_response() click to toggle source
# File lib/async/redis/context/generic.rb, line 46
def read_response
        @connection.flush
        
        return @connection.read_response
end
write_request(command, *arguments) click to toggle source
# File lib/async/redis/context/generic.rb, line 42
def write_request(command, *arguments)
        @connection.write_request([command, *arguments])
end