Reconnection Policies for PubNub Ruby SDK

Reconnection Policies

Pubnub Ruby SDK uses two parameters in reconnection logic: :reconnect_interval (in seconds) and :reconnect_attempts. They are set when initializing Pubnub::Client instance, by default their values are: 10 and 10.

When connection is lost, server logs warning "Connection lost! Reason: reasons", announces status to subscribers with type: Pubnub::Constants::TIMEOUT_ANNOUNCEMENT(:disconnect). Then waits :reconnect_interval and tries to connect. When reconnected client announces to subscribers status type: Pubnub::Constants::RECONNECTED_ANNOUNCEMENT (:reconnected).

Last updated on