diff options
Diffstat (limited to 'python-twisted/README.md')
| -rw-r--r-- | python-twisted/README.md | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/python-twisted/README.md b/python-twisted/README.md index 47045f5..2abefd5 100644 --- a/python-twisted/README.md +++ b/python-twisted/README.md @@ -10,6 +10,20 @@ from Pubnub import PubnubTwisted as Pubnub  #### Init  pubnub = Pubnub(publish_key="demo", subscribe_key="demo", ssl_on=False) +#### Publish Example +``` +channel = 'hello_world' +message = 'Hello World !!!' + +# Asynchronous usage + + +def callback(message): +    print(message) + +pubnub.publish(channel, message, callback=callback, error=callback) +``` +  #### IO Event Loop  ##### VERY IMPORTANT TO ADD THIS LINE AT THE VERY BOTTOM! | 
