Class: LS4::MembershipClientService

Inherits:
MembershipService show all
Defined in:
lib/ls4/service/membership.rb

Direct Known Subclasses

MembershipMemberService

Instance Method Summary collapse

Methods inherited from MembershipService

#get_active_rsids, #get_all_nodes, #get_node, #get_session_nid, #is_fault, #on_fault_list_change, #on_membership_change, #shutdown, #stat_fault_info, #stat_membership_info, #stat_replset_info

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

#initializeMembershipClientService

Returns a new instance of MembershipClientService.



230
231
232
# File 'lib/ls4/service/membership.rb', line 230

def initialize
	super
end

Instance Method Details

#runObject



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/ls4/service/membership.rb', line 234

def run
	super

	SyncBus.register_callback(SYNC_MEMBERSHIP,
						@membership.get_hash) do |obj|
		@membership.from_msgpack(obj)
		on_membership_change
		@membership.get_hash
	end

	SyncBus.register_callback(SYNC_FAULT_LIST,
						@fault_list.get_hash) do |obj|
		@fault_list.from_msgpack(obj)
		on_fault_list_change
		@fault_list.get_hash
	end
end