aboutsummaryrefslogtreecommitdiffstats
path: root/python/examples/console.py
diff options
context:
space:
mode:
authorDevendra2014-05-02 01:58:21 +0530
committerDevendra2014-05-02 01:58:21 +0530
commit8a642ab92c537c84960ef3943b34aac95bc39121 (patch)
tree08fc753470ad0817f14688d3e4933920e68f10b7 /python/examples/console.py
parent06511b3849e80cb5692ed92f7da31043c85556a0 (diff)
downloadpubnub-python-8a642ab92c537c84960ef3943b34aac95bc39121.tar.bz2
modifications for susbcribe loop events, connect, disconnect, reconnect
Diffstat (limited to 'python/examples/console.py')
-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):