A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://socketry.github.io/async-redis/source/Async/Redis/Context/Generic/index.html below:

Async::Redis::Context::Generic

class Generic

Base class for Redis command execution contexts.

Definitions def initialize(pool, *arguments)

Initialize a new generic context.

Signature
parameter pool Pool

The connection pool to use.

parameter arguments Array

Additional arguments for the context.

Implementation
def initialize(pool, *arguments)
	@pool = pool
	@connection = pool.acquire
end
def close

Close the context and release the connection back to the pool.

Implementation
def close
	if @connection
		@pool.release(@connection)
		@connection = nil
	end
end
def write_request(command, *arguments)

Write a Redis command request to the connection.

Signature
parameter command String

The Redis command.

parameter arguments Array

The command arguments.

Implementation
def write_request(command, *arguments)
	@connection.write_request([command, *arguments])
end
def read_response

Read a response from the Redis connection.

Signature
returns Object

The Redis response.

Implementation
def read_response
	@connection.flush
	
	return @connection.read_response
end
def call(command, *arguments)

Execute a Redis command and return the response.

Signature
parameter command String

The Redis command.

parameter arguments Array

The command arguments.

returns Object

The Redis response.

Implementation
def call(command, *arguments)
	write_request(command, *arguments)
	
	return read_response
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4