Class: Pubnub::OriginManager
Overview
OriginManager changes origin in client to online one and keeps monitoring available origins
Instance Attribute Summary collapse
-
#failback ⇒ Object
readonly
Returns the value of attribute failback.
-
#last_ping ⇒ Object
readonly
Returns the value of attribute last_ping.
Instance Method Summary collapse
- #current_origin ⇒ Object
-
#initialize(app) ⇒ OriginManager
constructor
A new instance of OriginManager.
- #offline_origins ⇒ Object
- #online_origins ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(app) ⇒ OriginManager
Returns a new instance of OriginManager.
8 9 10 |
# File 'lib/pubnub/origin_manager.rb', line 8 def initialize(app) @app = app end |
Instance Attribute Details
#failback ⇒ Object (readonly)
Returns the value of attribute failback.
6 7 8 |
# File 'lib/pubnub/origin_manager.rb', line 6 def failback @failback end |
#last_ping ⇒ Object (readonly)
Returns the value of attribute last_ping.
6 7 8 |
# File 'lib/pubnub/origin_manager.rb', line 6 def last_ping @last_ping end |
Instance Method Details
#current_origin ⇒ Object
20 21 22 |
# File 'lib/pubnub/origin_manager.rb', line 20 def current_origin @app.current_origin end |
#offline_origins ⇒ Object
28 29 30 |
# File 'lib/pubnub/origin_manager.rb', line 28 def offline_origins @app.offline_origins end |
#online_origins ⇒ Object
24 25 26 |
# File 'lib/pubnub/origin_manager.rb', line 24 def online_origins @app.online_origins end |
#start ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/pubnub/origin_manager.rb', line 12 def start origin_to_test = current_origin return false unless test_origin(origin_to_test) bring_down(origin_to_test) @app.reset_subscription end |