Class: Qup::Adapter::Redis::Connection
- Inherits:
-
Object
- Object
- Qup::Adapter::Redis::Connection
- Defined in:
- lib/qup/adapter/redis/connection.rb
Overview
Internal: The Common base class for Redis Topic and Queue
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Public: the name of the Queue or Topic.
Instance Method Summary collapse
-
#destroy ⇒ Object
Public: destroy the connection.
-
#initialize(uri, name) ⇒ Connection
constructor
Public: Create a new Connection.
Constructor Details
#initialize(uri, name) ⇒ Connection
Public: Create a new Connection
uri - the connection uri for the Redis Client name - the String name of the Connection
Returns a new Connection.
16 17 18 19 20 |
# File 'lib/qup/adapter/redis/connection.rb', line 16 def initialize( uri, name ) @uri = uri @client = Redis.new :host => @uri.host, :port => @uri.port @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Public: the name of the Queue or Topic
8 9 10 |
# File 'lib/qup/adapter/redis/connection.rb', line 8 def name @name end |
Instance Method Details
#destroy ⇒ Object
Public: destroy the connection
Closes the redis client connection.
Returns nothing.
27 28 29 |
# File 'lib/qup/adapter/redis/connection.rb', line 27 def destroy @client.client.disconnect end |