Class: FacebookService::BaseHandler
- Inherits:
-
Object
- Object
- FacebookService::BaseHandler
- Defined in:
- lib/extras/facebook_base_handler.rb
Direct Known Subclasses
Instance Method Summary collapse
- #aliveSince ⇒ Object
- #getCounter(key) ⇒ Object
- #getCounters ⇒ Object
- #getCpuProfile ⇒ Object
- #getName ⇒ Object
- #getOption(key) ⇒ Object
- #getOptions ⇒ Object
- #getStatus ⇒ Object
- #getStatusDetails ⇒ Object
- #getVersion ⇒ Object
-
#initialize(name) ⇒ BaseHandler
constructor
A new instance of BaseHandler.
- #reinitialize ⇒ Object
- #setOption(key, value) ⇒ Object
- #shutdown ⇒ Object
Constructor Details
#initialize(name) ⇒ BaseHandler
Returns a new instance of BaseHandler.
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/extras/facebook_base_handler.rb', line 3 def initialize(name) @name = name @alive = Time.now.to_i @counters = Hash.new { |h, k| h[k] = 0 } @counters_mutex = Mutex.new @options = Hash.new @options_mutex = Mutex.new end |
Instance Method Details
#aliveSince ⇒ Object
64 65 66 |
# File 'lib/extras/facebook_base_handler.rb', line 64 def aliveSince @alive end |
#getCounter(key) ⇒ Object
36 37 38 39 40 |
# File 'lib/extras/facebook_base_handler.rb', line 36 def getCounter(key) @counters_mutex.synchronize do @counters[key] end end |
#getCounters ⇒ Object
30 31 32 33 34 |
# File 'lib/extras/facebook_base_handler.rb', line 30 def getCounters @counters_mutex.synchronize do @counters end end |
#getCpuProfile ⇒ Object
60 61 62 |
# File 'lib/extras/facebook_base_handler.rb', line 60 def getCpuProfile(*) "" end |
#getName ⇒ Object
14 15 16 |
# File 'lib/extras/facebook_base_handler.rb', line 14 def getName @name end |
#getOption(key) ⇒ Object
48 49 50 51 52 |
# File 'lib/extras/facebook_base_handler.rb', line 48 def getOption(key) @options_mutex.synchronize do @options[key] end end |
#getOptions ⇒ Object
54 55 56 57 58 |
# File 'lib/extras/facebook_base_handler.rb', line 54 def getOptions @options_mutex.synchronize do @options end end |
#getStatus ⇒ Object
22 23 24 |
# File 'lib/extras/facebook_base_handler.rb', line 22 def getStatus Fb_status::ALIVE end |
#getStatusDetails ⇒ Object
26 27 28 |
# File 'lib/extras/facebook_base_handler.rb', line 26 def getStatusDetails "" end |
#getVersion ⇒ Object
18 19 20 |
# File 'lib/extras/facebook_base_handler.rb', line 18 def getVersion "" end |
#reinitialize ⇒ Object
68 69 |
# File 'lib/extras/facebook_base_handler.rb', line 68 def reinitialize end |
#setOption(key, value) ⇒ Object
42 43 44 45 46 |
# File 'lib/extras/facebook_base_handler.rb', line 42 def setOption(key, value) @options_mutex.synchronize do @options[key] = value end end |
#shutdown ⇒ Object
71 72 |
# File 'lib/extras/facebook_base_handler.rb', line 71 def shutdown end |