Class: LS4::SlaveService

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

Defined Under Namespace

Classes: Replicator

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

Constructor Details

#initializeSlaveService

Returns a new instance of SlaveService.



95
96
97
# File 'lib/ls4/service/slave.rb', line 95

def initialize
	@repls = {}  # {nid => Replicator}
end

Instance Method Details

#closeObject



102
103
104
105
106
# File 'lib/ls4/service/slave.rb', line 102

def close
	@repls.each_pair {|nid, repl|
		repl.close
	}
end

#openObject



99
100
# File 'lib/ls4/service/slave.rb', line 99

def open
end

#try_replicate(nid, session) ⇒ Object



108
109
110
111
# File 'lib/ls4/service/slave.rb', line 108

def try_replicate(nid, session)
	repl = open_replicator(nid)
	repl.try_replicate(session, PULL_LIMIT)
end