aboutsummaryrefslogtreecommitdiffstats
path: root/python/examples/subscribe.py
diff options
context:
space:
mode:
authorDevendra2015-06-16 14:10:23 +0530
committerDevendra2015-06-16 14:10:23 +0530
commit2ed5ac76e9719d3ba53ed9f7245c53e37347bddd (patch)
treef71254af529c39657fcb70ea96155c390bd3f234 /python/examples/subscribe.py
parent260d5fce4bf9f03f34584773dcac5f1d952a0d85 (diff)
downloadpubnub-python-2ed5ac76e9719d3ba53ed9f7245c53e37347bddd.tar.bz2
changing Pubnub to pubnub in files
Diffstat (limited to 'python/examples/subscribe.py')
-rw-r--r--python/examples/subscribe.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/examples/subscribe.py b/python/examples/subscribe.py
index 9b8b223..489c7c1 100644
--- a/python/examples/subscribe.py
+++ b/python/examples/subscribe.py
@@ -7,7 +7,7 @@
import sys
-from Pubnub import Pubnub
+from pubnub import Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo'
subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo'
@@ -19,7 +19,7 @@ ssl_on = len(sys.argv) > 5 and bool(sys.argv[5]) or False
## Initiate Pubnub State
## -----------------------------------------------------------------------
pubnub = Pubnub(publish_key=publish_key, subscribe_key=subscribe_key,
- secret_key=secret_key, cipher_key=cipher_key, ssl_on=ssl_on)
+ secret_key=secret_key, cipher_key=cipher_key, ssl_on=ssl_on, daemon=True)
channel = 'a'
@@ -45,5 +45,8 @@ def disconnect(message):
print("DISCONNECTED")
-pubnub.subscribe(channel, callback=callback, error=callback,
+pubnub.subscribe(channels=channel, callback=callback, error=callback,
connect=connect, reconnect=reconnect, disconnect=disconnect)
+import time
+while True:
+ time.sleep(10)