Class: InnerClientUpdater
- Defined in:
- lib/ff/ruby/server/sdk/api/inner_client_updater.rb
Instance Method Summary collapse
-
#initialize(poll_processor, client_callback, logger = nil) ⇒ InnerClientUpdater
constructor
A new instance of InnerClientUpdater.
- #on_connected ⇒ Object
- #on_disconnected ⇒ Object
- #on_error ⇒ Object
- #on_ready ⇒ Object
- #update(message) ⇒ Object
Constructor Details
#initialize(poll_processor, client_callback, logger = nil) ⇒ InnerClientUpdater
Returns a new instance of InnerClientUpdater.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ff/ruby/server/sdk/api/inner_client_updater.rb', line 7 def initialize( poll_processor, client_callback, logger = nil ) unless poll_processor.kind_of?(PollingProcessor) raise "The 'poll_processor' parameter must be of '" + PollingProcessor.to_s + "' data type" end unless client_callback.kind_of?(ClientCallback) raise "The 'client_callback' parameter must be of '" + ClientCallback.to_s + "' data type" end if logger != nil @logger = logger else @logger = Logger.new(STDOUT) end @poll_processor = poll_processor @client_callback = client_callback end |
Instance Method Details
#on_connected ⇒ Object
36 37 38 39 |
# File 'lib/ff/ruby/server/sdk/api/inner_client_updater.rb', line 36 def on_connected @poll_processor.stop end |
#on_disconnected ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/ff/ruby/server/sdk/api/inner_client_updater.rb', line 41 def on_disconnected unless @client_callback.is_closing @poll_processor.start end end |
#on_error ⇒ Object
54 55 56 57 |
# File 'lib/ff/ruby/server/sdk/api/inner_client_updater.rb', line 54 def on_error @logger.error "InnerClientUpdater error occurred" end |
#on_ready ⇒ Object
49 50 51 52 |
# File 'lib/ff/ruby/server/sdk/api/inner_client_updater.rb', line 49 def on_ready @client_callback.on_update_processor_ready() end |
#update(message) ⇒ Object
59 60 61 62 |
# File 'lib/ff/ruby/server/sdk/api/inner_client_updater.rb', line 59 def update() @client_callback.update(, false) end |