Class: LS4::SlaveService
- Inherits:
-
Service
- Object
- EventBus::Singleton
- Service
- LS4::SlaveService
- Defined in:
- lib/ls4/service/slave.rb
Defined Under Namespace
Classes: Replicator
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ SlaveService
constructor
A new instance of SlaveService.
- #open ⇒ Object
- #try_replicate(nid, session) ⇒ Object
Methods inherited from Service
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
Constructor Details
#initialize ⇒ SlaveService
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
#close ⇒ Object
102 103 104 105 106 |
# File 'lib/ls4/service/slave.rb', line 102 def close @repls.each_pair {|nid, repl| repl.close } end |
#open ⇒ Object
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 |