Class: Qup::Adapter::Redis

Inherits:
Qup::Adapter show all
Defined in:
lib/qup/adapter/redis.rb,
lib/qup/adapter/redis/queue.rb,
lib/qup/adapter/redis/topic.rb,
lib/qup/adapter/redis/connection.rb

Overview

Internal: The backing adapter for Qup that uses Redis as the messaging infrastructure

Defined Under Namespace

Classes: Connection, Queue, Topic

Instance Method Summary collapse

Methods inherited from Qup::Adapter

register

Constructor Details

#initialize(uri, options = {}) ⇒ Redis

Internal: Create a new Redis Adapter

uri - the URI instance for this adapter to use



15
16
17
18
19
# File 'lib/qup/adapter/redis.rb', line 15

def initialize( uri, options = {} )
  @uri        = uri
  @options    = options
  @closed     = false
end

Instance Method Details

#closeObject

Internal: Close the Redis adapter

Return nothing



42
43
44
# File 'lib/qup/adapter/redis.rb', line 42

def close
  @closed = true
end

#closed?Boolean

Internal: Is the Redis Adapter closed

Returns true or false

Returns:

  • (Boolean)


49
50
51
# File 'lib/qup/adapter/redis.rb', line 49

def closed?
  @closed
end

#queue(name) ⇒ Object

Internal: Create a new Queue from this Adapter

name - the String name of the Queue

Returns a Qup::Queue



26
27
28
# File 'lib/qup/adapter/redis.rb', line 26

def queue( name )
  Qup::Adapter::Redis::Queue.new( @uri, name )
end

#topic(name) ⇒ Object

Internal: Create a new Topic from this Adapter

name - the name of this Topic

Returns a Qup::Topic



35
36
37
# File 'lib/qup/adapter/redis.rb', line 35

def topic( name )
  Qup::Adapter::Redis::Topic.new( @uri, name )
end