Class: LS4::SyncClientService

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

Instance Method Summary collapse

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

#initializeSyncClientService

Returns a new instance of SyncClientService.



100
101
102
103
# File 'lib/ls4/service/sync.rb', line 100

def initialize
	@callback_array = []
	super
end

Instance Method Details

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



105
106
107
108
109
110
# File 'lib/ls4/service/sync.rb', line 105

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

#sync_blocking!Object



117
118
119
# File 'lib/ls4/service/sync.rb', line 117

def sync_blocking!
	do_sync.join
end

#try_syncObject



112
113
114
115
# File 'lib/ls4/service/sync.rb', line 112

def try_sync
	do_sync
	nil
end