Class: Pubnub::OriginManager
Overview
OriginManager changes origin in client to online one and keeps monitoring available origins
Instance Attribute Summary (collapse)
-
- (Object) failback
readonly
Returns the value of attribute failback.
-
- (Object) last_ping
readonly
Returns the value of attribute last_ping.
Instance Method Summary (collapse)
- - (Object) current_origin
-
- (OriginManager) initialize(app)
constructor
A new instance of OriginManager.
- - (Object) offline_origins
- - (Object) online_origins
- - (Object) start
Constructor Details
- (OriginManager) initialize(app)
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
- (Object) failback (readonly)
Returns the value of attribute failback
6 7 8 |
# File 'lib/pubnub/origin_manager.rb', line 6 def failback @failback end |
- (Object) last_ping (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
- (Object) current_origin
20 21 22 |
# File 'lib/pubnub/origin_manager.rb', line 20 def current_origin @app.current_origin end |
- (Object) offline_origins
28 29 30 |
# File 'lib/pubnub/origin_manager.rb', line 28 def offline_origins @app.offline_origins end |
- (Object) online_origins
24 25 26 |
# File 'lib/pubnub/origin_manager.rb', line 24 def online_origins @app.online_origins end |
- (Object) start
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 |