Pubnub Presence feature in Python (GAE)

旧时模样 提交于 2019-12-07 03:43:25

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!