Class: LS4::TimeCheckService

Inherits:
Service show all
Defined in:
lib/ls4/service/time_check.rb

Constant Summary collapse

THRESHOLD =
3
INTERVAL =
60*10

Instance Method Summary collapse

Methods inherited from Service

init

Methods included from EventBus::SingletonMixin

#ebus_bind!, #ebus_connect, extended

Methods included from EventBus::BusMixin

#ebus_all_slots, #ebus_disconnect!

Methods included from EventBus::DeclarerBase::Methods

#connect, #ebus_all_slots, #ebus_call_log, #ebus_call_slots, #ebus_signal_error, #ebus_signal_log, #ebus_signal_slots

Methods included from EventBus::DeclarerBase

#call_slot, #signal_slot

Instance Method Details

#check_blocking!Object



25
26
27
28
# File 'lib/ls4/service/time_check.rb', line 25

def check_blocking!
	do_check.join
	nil
end

#on_timerObject



41
42
43
# File 'lib/ls4/service/time_check.rb', line 41

def on_timer
	do_check if @timer
end

#runObject



30
31
32
33
34
# File 'lib/ls4/service/time_check.rb', line 30

def run
	@timer = ProcessBus.start_timer(INTERVAL, true) do
		on_timer
	end
end

#shutdownObject



36
37
38
39
# File 'lib/ls4/service/time_check.rb', line 36

def shutdown
	# FIXME stop @timer
	@timer = nil
end