Class: LS4::WeightManagerService

Inherits:
WeightService show all
Defined in:
lib/ls4/service/weight.rb

Instance Method Summary collapse

Methods inherited from WeightService

#get_registered_rsids, #get_weight, #run, #shutdown

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

Constructor Details

#initializeWeightManagerService

Returns a new instance of WeightManagerService.



70
71
72
# File 'lib/ls4/service/weight.rb', line 70

def initialize
	super
end

Instance Method Details

#reset_weight(rsid) ⇒ Object



83
84
85
86
87
88
89
90
# File 'lib/ls4/service/weight.rb', line 83

def reset_weight(rsid)
	if @winfo.reset_weight(rsid)
		on_change
		true
	else
		false
	end
end

#rpc_reset_replset_weight(rsid) ⇒ Object



96
97
98
# File 'lib/ls4/service/weight.rb', line 96

def rpc_reset_replset_weight(rsid)
	reset_weight(rsid)
end

#rpc_set_replset_weight(rsid, weight) ⇒ Object



92
93
94
# File 'lib/ls4/service/weight.rb', line 92

def rpc_set_replset_weight(rsid, weight)
	set_weight(rsid, weight)
end

#set_weight(rsid, weight) ⇒ Object



74
75
76
77
78
79
80
81
# File 'lib/ls4/service/weight.rb', line 74

def set_weight(rsid, weight)
	if @winfo.set_weight(rsid, weight)
		on_change
		true
	else
		false
	end
end