Class: RubyRabbitmqJanus::Janus::OneThread

Inherits:
Object
  • Object
show all
Defined in:
lib/rrj/janus/threads/thread.rb

Overview

Abstract class for janus Event and Keepalive

Author:

Direct Known Subclasses

Event, Keepalive

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOneThread

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

#conditionObject (private)

Returns the value of attribute condition.



21
22
23
# File 'lib/rrj/janus/threads/thread.rb', line 21

def condition
  @condition
end

#lockObject (private)

Returns the value of attribute lock.



21
22
23
# File 'lib/rrj/janus/threads/thread.rb', line 21

def lock
  @lock
end

#rabbitObject (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_threadObject (private)



17
18
19
# File 'lib/rrj/janus/threads/thread.rb', line 17

def start_thread
  Thread.new { initialize_thread }
end