From 2504fdad66f5372f8200e3b1b340c5043cc3e745 Mon Sep 17 00:00:00 2001 From: Devendra Date: Wed, 18 Jun 2014 02:40:06 +0530 Subject: readme updated for subscribe_sync --- python/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'python') diff --git a/python/README.md b/python/README.md index c077918..a3a6de8 100644 --- a/python/README.md +++ b/python/README.md @@ -60,6 +60,22 @@ pubnub.subscribe(channel, callback=callback, error=callback, connect=connect, reconnect=reconnect, disconnect=disconnect) ``` +#### SUBSCRIBE Synchronous ( pre 3.5 version ) +Runs in tight loop if callback return True. +Loop ends when callback return False +``` +# Listen for Messages + +channel = 'hello_world' + +def callback(message): + print(message) + return True + +pubnub.subscribe_sync(channel, callback=callback) +``` + + #### UNSUBSCRIBE ``` -- cgit v1.2.3