Class: Concurrent
- Inherits:
-
Object
- Object
- Concurrent
- Defined in:
- lib/concurrent/client.rb
Class Attribute Summary collapse
-
.redis_path ⇒ Object
Returns the value of attribute redis_path.
-
.redis_port ⇒ Object
Returns the value of attribute redis_port.
Class Method Summary collapse
- .config {|_self| ... } ⇒ Object
- .pull_ticket(uniq_tag) ⇒ Object
- .redis(redis_host = '127.0.0.1', redis_port = 6379) ⇒ Object
- .sync(uniq_tag) ⇒ Object
Class Attribute Details
.redis_path ⇒ Object
Returns the value of attribute redis_path.
6 7 8 |
# File 'lib/concurrent/client.rb', line 6 def redis_path @redis_path end |
.redis_port ⇒ Object
Returns the value of attribute redis_port.
6 7 8 |
# File 'lib/concurrent/client.rb', line 6 def redis_port @redis_port end |
Class Method Details
.config {|_self| ... } ⇒ Object
9 10 11 |
# File 'lib/concurrent/client.rb', line 9 def self.config yield self end |
.pull_ticket(uniq_tag) ⇒ Object
25 26 27 |
# File 'lib/concurrent/client.rb', line 25 def self.pull_ticket(uniq_tag) redis.brpop "client:#{uniq_tag}:list", 0 end |
.redis(redis_host = '127.0.0.1', redis_port = 6379) ⇒ Object
29 30 31 |
# File 'lib/concurrent/client.rb', line 29 def self.redis(redis_host = '127.0.0.1', redis_port = 6379) @@redis ||= Redis.new :host => redis_host, :port => redis_port end |