Class: LS4::SyncClientService
- Inherits:
-
SyncService
- Object
- EventBus::Singleton
- Service
- SyncService
- LS4::SyncClientService
- Defined in:
- lib/ls4/service/sync.rb
Instance Method Summary collapse
-
#initialize ⇒ SyncClientService
constructor
A new instance of SyncClientService.
- #register_callback(id, initial_hash, &block) ⇒ Object
- #sync_blocking! ⇒ Object
- #try_sync ⇒ Object
Methods inherited from SyncService
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 ⇒ SyncClientService
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_sync ⇒ Object
112 113 114 115 |
# File 'lib/ls4/service/sync.rb', line 112 def try_sync do_sync nil end |