Class: RubyRabbitmqJanus::Janus::OneThread
- Inherits:
-
Object
- Object
- RubyRabbitmqJanus::Janus::OneThread
- Defined in:
- lib/rrj/janus/threads/thread.rb
Overview
Abstract class for janus Event and Keepalive
Instance Attribute Summary collapse
-
#condition ⇒ Object
private
Returns the value of attribute condition.
-
#lock ⇒ Object
private
Returns the value of attribute lock.
-
#rabbit ⇒ Object
private
Returns the value of attribute rabbit.
Instance Method Summary collapse
-
#initialize ⇒ OneThread
constructor
Initialize class with elements for thread communication.
- #start_thread ⇒ Object private
Constructor Details
#initialize ⇒ OneThread
Initialize class with elements for thread communication
9 10 11 12 13 |
# File 'lib/rrj/janus/threads/thread.rb', line 9 def initialize @rabbit = Rabbit::Connect.new @lock = Mutex.new @condition = ConditionVariable.new end |
Instance Attribute Details
#condition ⇒ Object (private)
Returns the value of attribute condition.
21 22 23 |
# File 'lib/rrj/janus/threads/thread.rb', line 21 def condition @condition end |
#lock ⇒ Object (private)
Returns the value of attribute lock.
21 22 23 |
# File 'lib/rrj/janus/threads/thread.rb', line 21 def lock @lock end |
#rabbit ⇒ Object (private)
Returns the value of attribute rabbit.
21 22 23 |
# File 'lib/rrj/janus/threads/thread.rb', line 21 def rabbit @rabbit end |
Instance Method Details
#start_thread ⇒ Object (private)
17 18 19 |
# File 'lib/rrj/janus/threads/thread.rb', line 17 def start_thread Thread.new { initialize_thread } end |