Class: LS4::StandaloneSyncService

Inherits:
SyncServerService show all
Defined in:
lib/ls4/service/sync.rb

Instance Method Summary collapse

Methods inherited from SyncServerService

#check_hash, #rpc_sync_config, #update

Methods inherited from SyncService

#get_hash

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

#initializeStandaloneSyncService

Returns a new instance of StandaloneSyncService.



157
158
159
160
161
# File 'lib/ls4/service/sync.rb', line 157

def initialize
	@callback_array = []
	@client_hash_array = []
	super
end

Instance Method Details

#register_callback(id, initial_hash, &block) ⇒ Object



163
164
165
166
167
# File 'lib/ls4/service/sync.rb', line 163

def register_callback(id, initial_hash, &block)
	@callback_array[id] = block
	@client_hash_array[id] = initial_hash
	nil
end

#sync_blocking!Object



174
175
176
# File 'lib/ls4/service/sync.rb', line 174

def sync_blocking!
	do_sync.join
end

#try_syncObject



169
170
171
172
# File 'lib/ls4/service/sync.rb', line 169

def try_sync
	do_sync
	nil
end