Class: ZQ::Sources::RedisListOP

Inherits:
Object
  • Object
show all
Includes:
NonTransactional
Defined in:
lib/zq/sources/redis.rb

Direct Known Subclasses

RedisLPOP, RedisRPOP, RedisRPOPLPUSH

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from NonTransactional

#transactional?

Constructor Details

#initialize(client, listname) ⇒ RedisListOP

Returns a new instance of RedisListOP.



11
12
13
14
# File 'lib/zq/sources/redis.rb', line 11

def initialize(client, listname)
  @client = client
  @listname = listname
end

Class Attribute Details

.client_methodObject

Returns the value of attribute client_method.



8
9
10
# File 'lib/zq/sources/redis.rb', line 8

def client_method
  @client_method
end

Class Method Details

.method(client_method) ⇒ Object



24
25
26
# File 'lib/zq/sources/redis.rb', line 24

def self.method(client_method)
  self.client_method = client_method
end

Instance Method Details

#argsObject



20
21
22
# File 'lib/zq/sources/redis.rb', line 20

def args
  @listname
end

#read_nextObject



16
17
18
# File 'lib/zq/sources/redis.rb', line 16

def read_next
  @client.send(self.class.client_method, *args)
end