aboutsummaryrefslogtreecommitdiffstats
path: root/python/README.md
diff options
context:
space:
mode:
authorDevendra2014-12-31 02:27:47 +0530
committerDevendra2014-12-31 02:27:47 +0530
commite0b8230e747cac84fef69ecb261523f768f3616d (patch)
tree5fe958829e8820d0c09ab09926444f19153a0aec /python/README.md
parenta0ffcf82565df8358c8498dbf6da6889ef292b55 (diff)
downloadpubnub-python-e0b8230e747cac84fef69ecb261523f768f3616d.tar.bz2
modiying comments for docs
Diffstat (limited to 'python/README.md')
-rw-r--r--python/README.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/python/README.md b/python/README.md
index e9084e2..0ce3455 100644
--- a/python/README.md
+++ b/python/README.md
@@ -60,6 +60,37 @@ pubnub.subscribe(channel, callback=callback, error=callback,
connect=connect, reconnect=reconnect, disconnect=disconnect)
```
+#### SUBSCRIBE to group
+
+```
+# Listen for Messages
+
+channel_group = 'group1'
+
+def callback(message, channel_group, channel):
+ print(message)
+
+
+def error(message):
+ print("ERROR : " + str(message))
+
+
+def connect(message):
+ print("CONNECTED")
+
+
+def reconnect(message):
+ print("RECONNECTED")
+
+
+def disconnect(message):
+ print("DISCONNECTED")
+
+
+pubnub.subscribe_group(channel_group, callback=callback, error=callback,
+ connect=connect, reconnect=reconnect, disconnect=disconnect)
+```
+
#### SUBSCRIBE Synchronous ( compatible with pre-3.5 )
Runs in tight loop if callback return True.
Loop ends when callback return False
@@ -106,6 +137,25 @@ def error(message):
pubnub.presence(channel, callback=callback, error=callback)
```
+#### PRESENCE channel group
+
+```
+# Listen for Presence Event Messages
+
+channel_group = 'group1'
+
+def callback(message, channel_group, channel):
+ print(message)
+
+
+def error(message):
+ print("ERROR : " + str(message))
+
+
+
+pubnub.presence_group(channel_group, callback=callback, error=callback)
+```
+
#### HERE_NOW
```