Class: FacebookService::BaseHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/extras/facebook_base_handler.rb

Direct Known Subclasses

QueuedLogMessageHandler

Instance Method Summary collapse

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

#aliveSinceObject



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

#getCountersObject



30
31
32
33
34
# File 'lib/extras/facebook_base_handler.rb', line 30

def getCounters
  @counters_mutex.synchronize do
    @counters
  end
end

#getCpuProfileObject



60
61
62
# File 'lib/extras/facebook_base_handler.rb', line 60

def getCpuProfile(*)
  ""
end

#getNameObject



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

#getOptionsObject



54
55
56
57
58
# File 'lib/extras/facebook_base_handler.rb', line 54

def getOptions
  @options_mutex.synchronize do
    @options
  end
end

#getStatusObject



22
23
24
# File 'lib/extras/facebook_base_handler.rb', line 22

def getStatus
  Fb_status::ALIVE
end

#getStatusDetailsObject



26
27
28
# File 'lib/extras/facebook_base_handler.rb', line 26

def getStatusDetails
  ""
end

#getVersionObject



18
19
20
# File 'lib/extras/facebook_base_handler.rb', line 18

def getVersion
  ""
end

#reinitializeObject



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

#shutdownObject



71
72
# File 'lib/extras/facebook_base_handler.rb', line 71

def shutdown
end