PubNub, its really awesome for real-time communication. as per as documention given by pubnub team, am done with subscribe
and publish
instance, its working fine.
Now am wondering how get a particular user already/presence with PubNub channels in Python(GAE) apps, but I didn't find a complete guide to how to implement this feature in both server and client side.
NOTE: am using here Python Google App Engine & Javascript.
PubNub presence is a way to follow up on joins/leaves in a channel, what you need is the here_now feature if I understand correctly,
Taken from the Pyton lib is (https://github.com/pubnub/pubnub-api/tree/master/python/)
here_now = pubnub.here_now({
'channel' : 'hello_world',
})
print(here_now['occupancy'])
print(here_now['uuids'])
And now you can iterate on whoever is in the channel right now, this can't be done in the javascript though so you'd have to have perhaps another channel for each of your real channels that you can send the information from the server-side to the client side and then update something accordingly.
来源:https://stackoverflow.com/questions/15781842/pubnub-presence-feature-in-python-gae