NativeNativeTwistedTornadoAsyncioPythonReconnection Policies Tutorial for Python V4

 

These docs are for PubNub 4.0 for Python V4 which is our latest and greatest! For the docs of the older versions of the SDK, please check PubNub 3.0 for Python, PubNub 3.0 for Python-Tornado and PubNub 3.0 for Python-Twisted.

If you have questions about the PubNub for Python SDK, please contact us at support@pubnub.com.

Python SDK has three types of Reconnection Policies when there is a network or internet issue.

  1. (default) PNReconnectionPolicy.NONE - indicates that NO action will taken when there is a network or internet issue.
  2. PNReconnectionPolicy.LINEAR - SDK will try to reconnect each 3 seconds.
  3. PNReconnectionPolicy.EXPONENTIAL - SDK uses the Exponential Backoff algorithm to reconnect when there is a network or internet issue. SDK uses MINEXPONENTIALBACKOFF = 1 second and MAXEXPONENTIALBACKOFF = 32 seconds. See: https://en.wikipedia.org/wiki/Exponential_backoff for more details.