aboutsummaryrefslogtreecommitdiffstats
path: root/python/examples
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples')
-rw-r--r--python/examples/console.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/examples/console.py b/python/examples/console.py
index 240e5c0..fd9ebf4 100644
--- a/python/examples/console.py
+++ b/python/examples/console.py
@@ -127,7 +127,17 @@ def _subscribe_command_handler(channel):
def _error(r):
print_error(r, channel)
- pubnub.subscribe(channel, _callback, _error)
+
+ def _disconnect(r):
+ print_error("DISCONNECTED", channel)
+
+ def _reconnect(r):
+ print_error("RECONNECTED", channel)
+
+ def _connect(r):
+ print_error("CONNECTED", channel)
+
+ pubnub.subscribe(channel, _callback, _error,connect=_connect, disconnect=_disconnect, reconnect=_reconnect)
def _unsubscribe_command_handler(channel):