From 8a642ab92c537c84960ef3943b34aac95bc39121 Mon Sep 17 00:00:00 2001 From: Devendra Date: Fri, 2 May 2014 01:58:21 +0530 Subject: modifications for susbcribe loop events, connect, disconnect, reconnect --- python/examples/console.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'python/examples') 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): -- cgit v1.2.3